mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 13:40:31 +01:00
Apply PR comments
This commit is contained in:
parent
5ed75de0db
commit
ea4bd29d14
@ -228,7 +228,7 @@ impl<'t> Iterator for QueryPositionIterator<'t> {
|
|||||||
type Item = heed::Result<(u32, RoaringBitmap)>;
|
type Item = heed::Result<(u32, RoaringBitmap)>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
// sort inner words from the closest next position to the more far next position.
|
// sort inner words from the closest next position to the farthest next position.
|
||||||
let expected_pos = self
|
let expected_pos = self
|
||||||
.inner
|
.inner
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
@ -324,11 +324,12 @@ impl<'t> Branch<'t> {
|
|||||||
if docids.is_empty() {
|
if docids.is_empty() {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
qli.peek()
|
match qli.peek() {
|
||||||
.map(|result| {
|
Some(result) => {
|
||||||
result.as_ref().map(|(next_pos, _)| *next_pos - *pos).unwrap_or(0)
|
result.as_ref().map(|(next_pos, _)| *next_pos - *pos).unwrap_or(0)
|
||||||
})
|
}
|
||||||
.unwrap_or(u32::MAX)
|
None => u32::MAX,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.enumerate()
|
.enumerate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user