trackStringSearchCost tracks runtime cost for O(n*m) string search operations.
(args []ref.Val, _ ref.Val)
| 1045 | |
| 1046 | // trackStringSearchCost tracks runtime cost for O(n*m) string search operations. |
| 1047 | func trackStringSearchCost(args []ref.Val, _ ref.Val) *uint64 { |
| 1048 | searchCost := float64(actualSize(args[0])*actualSize(args[1])) * stringCostFactor |
| 1049 | cost := safeAdd(uint64(math.Ceil(searchCost)), callCost) |
| 1050 | return &cost |
| 1051 | } |
| 1052 | |
| 1053 | // trackStringReplaceCost tracks runtime cost for string replace operations, |
| 1054 | // accounting for search cost and the size of the result. |
nothing calls this directly
no test coverage detected