Add a threshold on proximity when choosing between linear/set algorithm

This commit is contained in:
many 2021-04-27 14:53:37 +02:00
parent 5a10de1b9f
commit 31607bf9cd
No known key found for this signature in database
GPG Key ID: 2CEF23B75189EACA

View File

@ -55,7 +55,7 @@ impl<'t> Criterion for Proximity<'t> {
if self.proximity as usize > *max_prox { if self.proximity as usize > *max_prox {
self.state = None; // reset state self.state = None; // reset state
} else { } else {
let mut new_candidates = if candidates.len() <= 1000 { let mut new_candidates = if candidates.len() <= 1000 && self.proximity > 0 {
if let Some(cache) = self.plane_sweep_cache.as_mut() { if let Some(cache) = self.plane_sweep_cache.as_mut() {
match cache.next() { match cache.next() {
Some((p, candidates)) => { Some((p, candidates)) => {