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

Function safeAdd

ext/costs.go:106–115  ·  view source on GitHub ↗
(x, y uint64, rest ...uint64)

Source from the content-addressed store, hash-verified

104}
105
106func safeAdd(x, y uint64, rest ...uint64) uint64 {
107 if y > 0 && x > math.MaxUint64-y {
108 return math.MaxUint64
109 }
110 next := x + y
111 if len(rest) == 0 {
112 return next
113 }
114 return safeAdd(next, rest[0], rest[1:]...)
115}
116
117func safeMul(x, y uint64) uint64 {
118 if y != 0 && x > math.MaxUint64/y {

Callers 11

estimateStringJoinCostFunction · 0.85
trackStringCharAtCostFunction · 0.85
trackStringTransformCostFunction · 0.85
trackStringSearchCostFunction · 0.85
trackStringReplaceCostFunction · 0.85
trackStringSplitCostFunction · 0.85
trackStringJoinCostFunction · 0.85
trackSetsCostFunction · 0.85
trackAllocatingListCallFunction · 0.85
extractCostTrackerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected