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

Method costCreateStruct

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

Source from the content-addressed store, hash-verified

645}
646
647func (c *coster) costCreateStruct(e ast.Expr) CostEstimate {
648 msgVal := e.AsStruct()
649 var sum CostEstimate
650 for _, ent := range msgVal.Fields() {
651 field := ent.AsStructField()
652 sum = sum.Add(c.cost(field.Value()))
653 }
654 return sum.Add(createMessageBaseCost)
655}
656
657func (c *coster) costComprehension(e ast.Expr) CostEstimate {
658 comp := e.AsComprehension()

Callers 1

costMethod · 0.95

Calls 6

AddMethod · 0.95
costMethod · 0.95
AsStructMethod · 0.65
FieldsMethod · 0.65
AsStructFieldMethod · 0.65
ValueMethod · 0.65

Tested by

no test coverage detected