Remove the temporary optimisation

This commit is contained in:
Kerollmops 2020-09-08 14:48:33 +02:00
parent 072382fa61
commit aed0704404
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -196,9 +196,6 @@ impl<'a> Search<'a> {
let mut documents = Vec::new();
let min_proximity = derived_words.len() as u32 - 1;
let mut number_min_proximity = 0;
// TODO move this function elsewhere
fn compute_proximity(path: &[Position]) -> u32 {
const ONE_ATTRIBUTE: u32 = 1000;
@ -232,10 +229,6 @@ impl<'a> Search<'a> {
near_proximity(keywords, &mut paths, compute_proximity);
if let Some((prox, _path)) = paths.first() {
documents.push((*prox, candidate));
if *prox == min_proximity {
number_min_proximity += 1;
if number_min_proximity >= limit { break }
}
}
}