MCPcopy Create free account
hub / github.com/cel-expr/cel-go / eachKey

Function eachKey

common/cost/model.go:175–181  ·  view source on GitHub ↗

eachKey calls fn with each key of a map. Values which are not maps have no keys.

(val ref.Val, fn func(ref.Val))

Source from the content-addressed store, hash-verified

173
174// eachKey calls fn with each key of a map. Values which are not maps have no keys.
175func eachKey(val ref.Val, fn func(ref.Val)) {
176 if m, ok := val.(traits.Mapper); ok {
177 for it := m.Iterator(); it.HasNext() == types.True; {
178 fn(it.Next())
179 }
180 }
181}
182
183// constExpr represents a constant integer quantity.
184type constExpr struct {

Callers 2

eachValueMethod · 0.85
exactSizeEstimateFunction · 0.85

Calls 3

IteratorMethod · 0.65
HasNextMethod · 0.65
NextMethod · 0.65

Tested by 1

exactSizeEstimateFunction · 0.68