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

Function stringTransformEvalCost

ext/strings.go:905–907  ·  view source on GitHub ↗

stringTransformEvalCost is the EvalCost of the O(n) string transforms: a scan of the receiver and the result's length.

()

Source from the content-addressed store, hash-verified

903// stringTransformEvalCost is the EvalCost of the O(n) string transforms: a scan of the receiver
904// and the result's length.
905func stringTransformEvalCost() cost.OverloadModelOption {
906 return cost.EvalCost(cost.Sum(cost.Const(cost.CallCost), cost.StringScan(cost.Length(cost.Target())), cost.Length(cost.Result())))
907}
908
909// stringCharAtCostModel models charAt: it scans the receiver and returns a single code point, which
910// is at most 4 UTF-8 bytes under the aggregate strategy and never above the receiver's size.

Callers 4

stringTrimCostModelFunction · 0.85
stringSubstringCostModelFunction · 0.85

Calls 7

EvalCostFunction · 0.92
SumFunction · 0.92
ConstFunction · 0.92
StringScanFunction · 0.92
LengthFunction · 0.92
TargetFunction · 0.92
ResultFunction · 0.92

Tested by

no test coverage detected