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

Method costCreateStruct

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

Source from the content-addressed store, hash-verified

615}
616
617func (c *coster) costCreateStruct(e ast.Expr) CostEstimate {
618 msgVal := e.AsStruct()
619 var sum CostEstimate
620 for _, ent := range msgVal.Fields() {
621 field := ent.AsStructField()
622 sum = sum.Add(c.cost(field.Value()))
623 }
624 return sum.Add(createMessageBaseCost)
625}
626
627func (c *coster) costComprehension(e ast.Expr) CostEstimate {
628 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