Merge pull request #118 from meilisearch/fix-offset

fix broken offset
This commit is contained in:
Clément Renault 2021-03-15 22:15:18 +01:00 committed by GitHub
commit 6b7cc0022b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,7 +133,7 @@ impl<'a> Search<'a> {
initial_candidates.union_with(&bucket_candidates);
if offset != 0 {
candidates.by_ref().skip(offset).for_each(drop);
candidates.by_ref().take(offset).for_each(drop);
offset = offset.saturating_sub(len.min(offset));
len = len.saturating_sub(len.min(offset));
}