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

Function stringSplitCostModel

ext/strings.go:1018–1027  ·  view source on GitHub ↗

stringSplitCostModel models split: it scans the receiver and allocates the parts.

(id string)

Source from the content-addressed store, hash-verified

1016
1017// stringSplitCostModel models split: it scans the receiver and allocates the parts.
1018func stringSplitCostModel(id string) cost.OverloadModel {
1019 return cost.MemberOverload(id,
1020 cost.EvalCost(cost.AllocList(
1021 cost.StringScan(cost.Sum(cost.Length(cost.Target()), cost.Const(1))),
1022 cost.Length(cost.Result()),
1023 )),
1024 cost.ResultSize(splitSize(cost.Target())),
1025 cost.BeforeVersion(1, cost.ResultSize(cost.List(cost.AtMost(cost.Target()), cost.AtMost(cost.Target())))),
1026 )
1027}
1028

Callers 1

CompileOptionsMethod · 0.85

Calls 14

MemberOverloadFunction · 0.92
EvalCostFunction · 0.92
AllocListFunction · 0.92
StringScanFunction · 0.92
SumFunction · 0.92
LengthFunction · 0.92
TargetFunction · 0.92
ConstFunction · 0.92
ResultFunction · 0.92
ResultSizeFunction · 0.92
BeforeVersionFunction · 0.92
ListFunction · 0.92

Tested by

no test coverage detected