Cost estimation functions for string extensions. These functions provide compile-time cost estimates proportional to the size of the input string(s), ensuring that the CEL cost system accurately reflects the computational work performed by string operations. estimateStringFixedTransformCost estimat
(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode)
| 901 | // estimateStringFixedTransformCost estimates cost for O(n) string operations such as |
| 902 | // lowerAscii, upperAsciil, reverse and quote. |
| 903 | func estimateStringFixedTransformCost(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { |
| 904 | if target == nil { |
| 905 | return nil |
| 906 | } |
| 907 | cost, size := estimateStringScan(estimateSize(estimator, *target)) |
| 908 | return callEstimate(cost.Add(callCostEstimate).Add(size.AsCost()), size) |
| 909 | } |
| 910 | |
| 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. |
nothing calls this directly
no test coverage detected