def is_last

bend-lint-rules@0.2.0.0 · performance/deep_call_in_fork.bend:28

import bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend as DeepCallInFork
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists

28# Whether `at` is the place of the last of `nodes`.
29def is_last(nodes: List<&2, Lint.Node>, at: U32) -> Bool:
30  U32.is_eq((at + 1: U32), U32.from_nat(Lists.length(&2, Lint.Node, nodes)))

Uses (8)

Used by (4)