Skip to content

Commit

Permalink
Only consider multiplicitous entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed May 15, 2024
1 parent b54a58b commit a95e06d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ pub(super) fn find_most_common_histogram_entry_with_default<T: Copy>(histogram:
}

pub(super) fn find_leading_histogram_entries(histogram: HashMap<NodeFeatures, usize>, count: usize) -> Vec<NodeFeatures> {
let mut entry_counts: Vec<_> = histogram.iter().collect();
let mut entry_counts: Vec<_> = histogram.iter().filter(|&(_, &count)| count > 1).collect();
entry_counts.sort_by(|a, b| b.1.cmp(&a.1));
entry_counts.into_iter().take(count).map(|a| a.0.clone()).collect()
}
}

0 comments on commit a95e06d

Please sign in to comment.