estimateListCallWithDirectCost computes cost using a pre-calculated CostEstimate and a separate result size estimate.
(cost checker.CostEstimate, resultSize checker.SizeEstimate, allocates bool)
| 840 | |
| 841 | // estimateListCallWithDirectCost computes cost using a pre-calculated CostEstimate and a separate result size estimate. |
| 842 | func 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. |
| 851 | func trackListOutputSize(_ []ref.Val, result ref.Val) *uint64 { |
no test coverage detected