def repeats

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

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

198# Whether `c` repeats a call of `seen`: the same definition, in the same branch, with arguments written the same way.
199def repeats(seen: List<&2, Call>, +c: Call, found: Bool) -> Bool:
200  match seen found:
201    case _ True{}:
202      True{}
203    case Nil{} False{}:
204      False{}
205    case Con{Call{t, callee, args, span, b}, rest} False{}:
206      repeats(
207        rest,
208        c,
209        is_same(
210          256n,
211          args,
212          Call.args(c),
213          String.eq(t, Call.target(c)) && U32.is_eq(b, Call.branch(c))
214        )
215      )

Uses (10)

Used by (1)