def message

bend-lint-rules@0.2.0.0 · performance/list_index_loop.bend:175

import bend-lint-rules@0.2.0.0/performance/list_index_loop.bend as ListIndexLoop
import Base

175def message(+callee: String, +through: String, +list: String, loop: String) -> String:
176  callee
177    ++ " walks "
178    ++ list
179    ++ " from its head"
180    ++ Bool.pick(String, String.eq(callee, through), "", " (through " ++ through ++ ")")
181    ++ ", and "
182    ++ loop
183    ++ " passes "
184    ++ list
185    ++ " unchanged to each call of itself, so a loop that visits each of its n items takes O(n²) time. All lanes. Confidence: high, as each step walks the list again. "
186    ++ advice(through, list)
187    ++ " If the list stays short, expect this finding."

Uses (5)

Used by (1)