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

Method Add

checker/cost.go:185–190  ·  view source on GitHub ↗

Add adds the costs and returns the sum. If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64.

(cost CostEstimate)

Source from the content-addressed store, hash-verified

183// Add adds the costs and returns the sum.
184// If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64.
185func (ce CostEstimate) Add(cost CostEstimate) CostEstimate {
186 return CostEstimate{
187 Min: addUint64NoOverflow(ce.Min, cost.Min),
188 Max: addUint64NoOverflow(ce.Max, cost.Max),
189 }
190}
191
192// Multiply multiplies by the cost and returns the product.
193// If multiply would result in an uint64 overflow, the result is math.MaxUint64.

Callers 9

costSelectMethod · 0.95
costCallMethod · 0.95
costCreateListMethod · 0.95
costCreateMapMethod · 0.95
costCreateStructMethod · 0.95
costComprehensionMethod · 0.95
costBindMethod · 0.95
functionCostMethod · 0.95
TestCostFunction · 0.95

Calls 1

addUint64NoOverflowFunction · 0.85

Tested by 1

TestCostFunction · 0.76