RepeatedCall.visit: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/performance/repeated_call.bend as RepeatedCall Lines 125-158 of bend-lint-rules@0.2.0.0/performance/repeated_call.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&start_line=125&end_line=158 import Base import bend-lint-api@0.2.0.0/linter/lint.bend as Lint import bend-lint-api@0.2.0.0/shared/names.bend as Names import bend-lint-rules@0.2.0.0/performance/loop_invariant_call.bend as Invariant # The call of a definition that loops at an application below `path`, if it counts. def visit(+scope: Scope, +path: List<&2, Lint.Above>, +node: Lint.Node) -> List<&2, Call>: match scope node: case Scope{ Invariant.Owner{+loops, target, name, fixed}, defs } Lint.Node{ Lint.Application{}, n, Some{span}, Con{Lint.Node{Lint.Reference{+t}, callee, rs, rk, rf}, args}, f }: Bool.pick( List<&2, Call>, is_kept( List.contains( ~String, ~String.eq, loops, t ) && returns_number(Names.find(Lint.Def, defs, t)) && Lint.is_live(path) && Bool.not(is_guarded(path, False{})), Invariant.Owner{loops, target, name, fixed}, path, node ), [Call{t, callee, args, span, branch.at(Invariant.branch(path, None{}))}], [] ) case _ _: [] Uses (23): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Above https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Def https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Syntax https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=is_live https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/shared/names.bend&name=find https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/loop_invariant_call.bend&name=Owner https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/loop_invariant_call.bend&name=branch https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&name=Call https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&name=Scope https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&name=branch.at https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&name=is_guarded https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&name=is_kept https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&name=returns_number