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

Method computeEntrySize

checker/cost.go:977–988  ·  view source on GitHub ↗
(e ast.Expr)

Source from the content-addressed store, hash-verified

975}
976
977func (c *coster) computeEntrySize(e ast.Expr) *entrySizeEstimate {
978 if sz, found := c.computedEntrySizes[e.ID()]; found {
979 return &sz
980 }
981 if e.Kind() == ast.IdentKind {
982 varName := e.AsIdent()
983 if v, ok := c.peekLocalVar(varName); ok && v.entrySize != nil {
984 return v.entrySize
985 }
986 }
987 return nil
988}
989
990func computeExprSize(expr ast.Expr) *SizeEstimate {
991 var v uint64

Callers 8

pushIterKeyMethod · 0.95
pushIterValueMethod · 0.95
pushIterSingleMethod · 0.95
pushLocalVarMethod · 0.95
costCallMethod · 0.95
costComprehensionMethod · 0.95
functionCostMethod · 0.95
copySizeEstimatesMethod · 0.95

Calls 4

peekLocalVarMethod · 0.95
IDMethod · 0.65
KindMethod · 0.65
AsIdentMethod · 0.65

Tested by

no test coverage detected