AppendInLoop.accumulated: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/performance/append_in_loop.bend as AppendInLoop Lines 115-140 of bend-lint-rules@0.2.0.0/performance/append_in_loop.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/performance/append_in_loop.bend&start_line=115&end_line=140 import Base import bend-lint-api@0.2.0.0/linter/lint.bend as Lint # The finding about an append (`a`, at `span`, with `args`) to `acc`, if it is a parameter of the loop `name` that its # call does not also use (in `before` and `after`, its nodes but the append): then it keeps each value the loop builds, # and the copies are needed. def accumulated( acc: Maybe<&2, Lint.Node>, a: Append, loop: Loop, name: String, span: Lint.Span, args: List<&2, Lint.Node>, before: List<&2, Lint.Node>, after: List<&2, Lint.Node> ) -> List<&2, Lint.Finding>: match acc loop: case Some{Lint.Node{Lint.Variable{+b}, var, s, k, f}} Loop{params, text}: judged( has(after, b, has(before, b, Maybe.is_none(&2, Nat, Lint.parameter(params, b)))), a, name, var, span, text, args ) case _ _: [] Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.is_none https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Finding 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=Span 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=parameter https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/append_in_loop.bend&name=Append https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/append_in_loop.bend&name=Loop https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/append_in_loop.bend&name=has https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/append_in_loop.bend&name=judged