def advice
import bend-lint-rules@0.2.0.0/performance/list_index_loop.bend as ListIndexLoopimport Base
167def advice(through: String, list: String) -> String:
168 Bool.pick(
169 String,
170 String.eq(through, "List.length"),
171 "Compute the length once before the loop, and pass it as a parameter.",
172 "Walk " ++ list ++ " instead: match it, use its head, and pass its tail to the next call."
173 )