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

Method pushIterKey

checker/cost.go:402–415  ·  view source on GitHub ↗
(varName string, rangeExpr ast.Expr)

Source from the content-addressed store, hash-verified

400}
401
402func (c *coster) pushIterKey(varName string, rangeExpr ast.Expr) {
403 entrySize := c.computeEntrySize(rangeExpr)
404 size := entrySize.keySize()
405 path := c.getPath(rangeExpr)
406 container := entrySize.container()
407 if container == types.UnknownKind {
408 container = c.getType(rangeExpr).Kind()
409 }
410 subpath := "@keys"
411 if container == types.ListKind {
412 subpath = "@indices"
413 }
414 c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
415}
416
417func (c *coster) pushIterValue(varName string, rangeExpr ast.Expr) {
418 entrySize := c.computeEntrySize(rangeExpr)

Callers 1

costComprehensionMethod · 0.95

Calls 7

computeEntrySizeMethod · 0.95
getPathMethod · 0.95
getTypeMethod · 0.95
keySizeMethod · 0.80
containerMethod · 0.80
KindMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected