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

Function estimateListCallWithDirectCost

ext/lists.go:842–848  ·  view source on GitHub ↗

estimateListCallWithDirectCost computes cost using a pre-calculated CostEstimate and a separate result size estimate.

(cost checker.CostEstimate, resultSize checker.SizeEstimate, allocates bool)

Source from the content-addressed store, hash-verified

840
841// estimateListCallWithDirectCost computes cost using a pre-calculated CostEstimate and a separate result size estimate.
842func estimateListCallWithDirectCost(cost checker.CostEstimate, resultSize checker.SizeEstimate, allocates bool) *checker.CallEstimate {
843 if allocates {
844 cost = cost.Add(checker.FixedCostEstimate(common.ListCreateBaseCost))
845 }
846 cost = cost.Add(callCostEstimate)
847 return &checker.CallEstimate{CostEstimate: cost, ResultSize: &resultSize}
848}
849
850// trackListOutputSize computes cost as a function of the size of the result list.
851func trackListOutputSize(_ []ref.Val, result ref.Val) *uint64 {

Callers 5

estimateListFlattenFunction · 0.85
estimateListDistinctFunction · 0.85
estimateListSortByCostFunction · 0.85
estimateListSortCostFunction · 0.85

Calls 2

FixedCostEstimateFunction · 0.92
AddMethod · 0.65

Tested by

no test coverage detected