estimateStringVariableTransformCost estimates cost for O(n) string operations that result in a variable sized string which may be empty to the exact input string.
(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode)
| 911 | // estimateStringVariableTransformCost estimates cost for O(n) string operations that result |
| 912 | // in a variable sized string which may be empty to the exact input string. |
| 913 | func estimateStringVariableTransformCost(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { |
| 914 | if target == nil { |
| 915 | return nil |
| 916 | } |
| 917 | cost, size := estimateStringScan(estimateSize(estimator, *target)) |
| 918 | transformSize := rangedSizeEstimate(0, size.Max) |
| 919 | return callEstimate(cost.Add(callCostEstimate).Add(transformSize.AsCost()), &transformSize) |
| 920 | } |
| 921 | |
| 922 | // estimateStringCharAtCost includes a cost of 1 for the allocation, plus the string traversal cost. |
| 923 | func estimateStringCharAtCost(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { |
nothing calls this directly
no test coverage detected