dataPointGreaterThan returns true if the new value should replace the smallest in a topk heap. This happens when the new value is greater, or equal but alphabetically earlier.
(a, b seriesValue)
| 39 | // dataPointGreaterThan returns true if the new value should replace the smallest in a topk heap. |
| 40 | // This happens when the new value is greater, or equal but alphabetically earlier. |
| 41 | func dataPointGreaterThan(a, b seriesValue) bool { |
| 42 | if a.value == b.value { |
| 43 | return compareSeriesMapKey(a.key, b.key) > 0 |
| 44 | } |
| 45 | |
| 46 | return a.value > b.value |
| 47 | } |
| 48 | |
| 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. |