(opts *SetPathOpts, pp pathWithPos, cost int)
| 240 | } |
| 241 | |
| 242 | func checkAndModifyBudget(opts *SetPathOpts, pp pathWithPos, cost int) bool { |
| 243 | if opts.Budget == 0 { |
| 244 | return true |
| 245 | } |
| 246 | opts.Budget -= cost |
| 247 | if opts.Budget < 0 { |
| 248 | return false |
| 249 | } |
| 250 | if opts.Budget == 0 { |
| 251 | // 0 is weird since it means unlimited, so we set it to -1 to fail the next operation |
| 252 | opts.Budget = -1 |
| 253 | } |
| 254 | return true |
| 255 | } |
| 256 | |
| 257 | func CombineFn_ArrayAppend(data any, value any, pp pathWithPos, opts SetPathOpts) (any, error) { |
| 258 | if !checkAndModifyBudget(&opts, pp, 1) { |
no outgoing calls
no test coverage detected