fix: Break the proper loop when bucket sorting

This commit is contained in:
Clément Renault 2018-12-10 15:14:15 +01:00
parent d36a8abbc2
commit 671bd3374f
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE

View File

@ -112,11 +112,11 @@ where D: Deref<Target=DB>,
let mut groups = vec![documents.as_mut_slice()];
let view = &self.view;
'group: for criterion in &self.criteria {
for criterion in &self.criteria {
let tmp_groups = mem::replace(&mut groups, Vec::new());
let mut computed = 0;
for group in tmp_groups {
'group: for group in tmp_groups {
group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view));
for group in GroupByMut::new(group, |a, b| criterion.eq(a, b, view)) {
computed += group.len();