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

Function trackAllocatingListCall

ext/lists.go:901–907  ·  view source on GitHub ↗

trackAllocatingListCall computes costs as a function of the size of the result list with a baseline cost for the call dispatch and the associated list allocation.

(costFactor float64, size uint64)

Source from the content-addressed store, hash-verified

899// trackAllocatingListCall computes costs as a function of the size of the result list with a baseline cost
900// for the call dispatch and the associated list allocation.
901func trackAllocatingListCall(costFactor float64, size uint64) *uint64 {
902 if costFactor < 0.0 {
903 costFactor = 1.0
904 }
905 cost := safeAdd(uint64(float64(size)*costFactor), callCost, common.ListCreateBaseCost)
906 return &cost
907}
908
909func estimateListDistinctLegacy(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
910 if target == nil || len(args) != 0 {

Callers 4

trackListOutputSizeFunction · 0.85
trackListFlattenFunction · 0.85
trackListFlattenLegacyFunction · 0.85
trackListSelfCompareFunction · 0.85

Calls 1

safeAddFunction · 0.70

Tested by

no test coverage detected