def data

bend-lint-rules@0.2.0.0 · performance/gpu_fit.bend:140

import bend-lint-rules@0.2.0.0/performance/gpu_fit.bend as GpuFit
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists

140# The first parameter of `params` that is data, if one is.
141def data(
142  params: List<&2, Lint.Param>,
143  found: Maybe<&2, Lint.Param>,
144  +slots: List<&2, Slot>
145) -> Maybe<&2, Lint.Param>:
146  match params found:
147    case _ Some{param}:
148      Some{param}
149    case Nil{} None{}:
150      None{}
151    case Con{Lint.Param{n, +ty}, rest} None{}:
152      data(
153        rest,
154        Lists.when(Lint.Param, Bool.not(is_flat(64n, Some{[ty]}, slots)), Lint.Param{n, ty}),
155        slots
156      )

Uses (7)

Used by (2)