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

Function listJoinCostModel

ext/strings.go:969–975  ·  view source on GitHub ↗

listJoinCostModel models l.join(): it reads the list once and builds the concatenated result.

(id string)

Source from the content-addressed store, hash-verified

967
968// listJoinCostModel models l.join(): it reads the list once and builds the concatenated result.
969func listJoinCostModel(id string) cost.OverloadModel {
970 return cost.MemberOverload(id,
971 cost.EvalCost(cost.Sum(cost.Const(cost.CallCost), cost.StringScan(cost.Sum(cost.Length(cost.Target()), cost.Const(1))), cost.Length(cost.Result()))),
972 cost.ResultSize(cost.AtMost(cost.ElemTotal(cost.Target()))),
973 cost.BeforeVersion(1, cost.ResultSize(cost.AtMost(cost.Length(cost.Target())))),
974 )
975}
976
977// listJoinStringCostModel models l.join(delim): it reads the list once and builds the result with
978// delimiters between elements.

Callers 1

CompileOptionsMethod · 0.85

Calls 12

MemberOverloadFunction · 0.92
EvalCostFunction · 0.92
SumFunction · 0.92
ConstFunction · 0.92
StringScanFunction · 0.92
LengthFunction · 0.92
TargetFunction · 0.92
ResultFunction · 0.92
ResultSizeFunction · 0.92
AtMostFunction · 0.92
ElemTotalFunction · 0.92
BeforeVersionFunction · 0.92

Tested by

no test coverage detected