def first_beg

bend-lint-rules@0.2.0.0 · performance/repeated_call.bend:89

import bend-lint-rules@0.2.0.0/performance/repeated_call.bend as RepeatedCall
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

89# Where the first of `nodes`, or a node under it, that has a place starts.
90def first_beg(+fuel: Nat, nodes: List<&2, Lint.Node>) -> U32:
91  match fuel nodes:
92    case 0n _:
93      0
94    case _ Nil{}:
95      0
96    case 1n+f Con{Lint.Node{syntax, n, Some{Lint.Span{p, beg, end}}, k, fs}, rest}:
97      beg
98    case 1n+f Con{Lint.Node{syntax, n, None{}, k, fs}, rest}:
99      first_beg(f, List.append(&2, Lint.Node, k, rest))

Uses (7)

Used by (1)