From 5d1627e52da7cd44cdd72d0b4d977df372084ba9 Mon Sep 17 00:00:00 2001 From: Hardik Prajapati Date: Wed, 7 Apr 2021 23:14:38 +0530 Subject: [PATCH] Implementation of Ord trait changed for Hit - This will result in lexicographical ordering of facet in BinaryHeep in case of a tie --- src/collector/facet_collector.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/collector/facet_collector.rs b/src/collector/facet_collector.rs index 077da6b0f..108a5d1f3 100644 --- a/src/collector/facet_collector.rs +++ b/src/collector/facet_collector.rs @@ -37,7 +37,10 @@ impl<'a> PartialOrd> for Hit<'a> { impl<'a> Ord for Hit<'a> { fn cmp(&self, other: &Self) -> Ordering { - other.count.cmp(&self.count) + match other.count.cmp(&self.count) { + Ordering::Equal => self.facet.cmp(other.facet), + x => x, + } } }