Method
BatchSlice
(results []AggregatorResErr)
Source from the content-addressed store, hash-verified
| 427 | } |
| 428 | |
| 429 | func (a *AggMaxAggregator) BatchSlice(results []AggregatorResErr) error { |
| 430 | max := int64(math.MinInt64) |
| 431 | |
| 432 | for _, res := range results { |
| 433 | if res.Err != nil { |
| 434 | _ = a.Add(nil, res.Err) |
| 435 | return nil |
| 436 | } |
| 437 | |
| 438 | resInt, err := toInt64(res.Result) |
| 439 | if err != nil { |
| 440 | _ = a.Add(nil, res.Err) |
| 441 | return nil |
| 442 | } |
| 443 | |
| 444 | if resInt > max { |
| 445 | max = resInt |
| 446 | } |
| 447 | |
| 448 | } |
| 449 | |
| 450 | return a.Add(max, nil) |
| 451 | } |
| 452 | |
| 453 | func (a *AggMaxAggregator) Result() (interface{}, error) { |
| 454 | err := a.err.Load() |
Callers
nothing calls this directly
Tested by
no test coverage detected