dataPointLessThan returns true if the new value should replace the largest in a bottomk heap. This happens when the new value is smaller, or equal but alphabetically earlier.
(a, b seriesValue)
| 49 | // dataPointLessThan returns true if the new value should replace the largest in a bottomk heap. |
| 50 | // This happens when the new value is smaller, or equal but alphabetically earlier. |
| 51 | func dataPointLessThan(a, b seriesValue) bool { |
| 52 | if a.value == b.value { |
| 53 | return compareSeriesMapKey(a.key, b.key) < 0 |
| 54 | } |
| 55 | |
| 56 | return a.value < b.value |
| 57 | } |
| 58 | |
| 59 | // seriesHeap implements a min-heap of seriesValue |
| 60 | type seriesHeap []seriesValue |