mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Ignore every proximities bigger or equal to 8
This commit is contained in:
parent
3577de04b8
commit
a3ca80d20d
@ -65,7 +65,7 @@ impl Node {
|
|||||||
parent_position: *position,
|
parent_position: *position,
|
||||||
};
|
};
|
||||||
// We do not produce the nodes we have already seen in previous iterations loops.
|
// We do not produce the nodes we have already seen in previous iterations loops.
|
||||||
if node.is_complete(positions) && acc_proximity + proximity < best_proximity {
|
if proximity > 7 || (node.is_complete(positions) && acc_proximity + proximity < best_proximity) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some((node, proximity))
|
Some((node, proximity))
|
||||||
@ -140,7 +140,7 @@ where F: FnMut((usize, u32), (usize, u32)) -> bool,
|
|||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
let before = Instant::now();
|
let before = Instant::now();
|
||||||
|
|
||||||
if self.best_proximity == self.positions.len() as u32 * MAX_DISTANCE {
|
if self.best_proximity == self.positions.len() as u32 * (MAX_DISTANCE - 1) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user