def say

bolt@1.27.0.0 · src/rules/suspicious/empty.bend:219

import bolt@1.27.0.0/src/rules/suspicious/empty.bend as Empty
import Base

219# what a finding says: the test, its fix and why
220def say(fm: Form, +xx: String) -> String:
221  match fm:
222    case FList{}:
223      "Nat.is_eq(List.length(.., " ++ xx ++ "), 0n) counts every cell of " ++ xx ++ ", which is read again; List.is_empty(.., "
224        ++ xx ++ ") looks at one and gives the same answer."
225    case other:
226      "Nat.is_eq(String.length(" ++ xx ++ "), 0n) counts every char of " ++ xx ++ ", which is read again; String.is_empty("
227        ++ xx ++ ") looks at one and gives the same answer."

Uses (3)

Used by (1)