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

Method pushIterSingle

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

Source from the content-addressed store, hash-verified

430}
431
432func (c *coster) pushIterSingle(varName string, rangeExpr ast.Expr) {
433 entrySize := c.computeEntrySize(rangeExpr)
434 size := entrySize.keySize()
435 subpath := "@keys"
436 container := entrySize.container()
437 if container == types.UnknownKind {
438 container = c.getType(rangeExpr).Kind()
439 }
440 if container == types.ListKind {
441 size = entrySize.valSize()
442 subpath = "@items"
443 }
444 path := c.getPath(rangeExpr)
445 c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
446}
447
448func (c *coster) pushLocalVar(varName string, e ast.Expr) {
449 path := c.getPath(e)

Callers 1

costComprehensionMethod · 0.95

Calls 8

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

Tested by

no test coverage detected