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