From beb49b24f611bd5e0dbb0d2d8f32f7c1fe2df33b Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Sat, 20 Jun 2020 13:19:03 +0200 Subject: [PATCH] Skip looking at connections for proximity 0 --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 621feee09..e0ddac3b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -126,6 +126,7 @@ impl Index { let mut runion_docids = RoaringBitmap::default(); let contains_documents = |(lword, lpos): (usize, u32), (rword, rpos): (usize, u32)| { let proximity = best_proximity::positions_proximity(lpos, rpos); + if proximity == 0 { return false } *intersect_cache.entry(((lword, lpos), (rword, rpos))).or_insert_with(|| { // let (nb_words, nb_docs_intersect, lnblookups, lnbbitmaps, rnblookups, rnbbitmaps) =