Only call plane_sweep on subgroups when 2 or more are present

This commit is contained in:
Samyak Sarnayak 2022-10-28 19:32:05 +05:30
parent d35afa0cf5
commit 03eb5d87c1
No known key found for this signature in database
GPG Key ID: 754DB639009A05CE

View File

@ -496,7 +496,11 @@ fn resolve_plane_sweep_candidates(
None => return Ok(vec![]), None => return Ok(vec![]),
} }
} }
groups_positions.push(plane_sweep(subgroup, true)?); match subgroup.len() {
0 => {},
1 => groups_positions.push(subgroup.pop().unwrap()),
_ => groups_positions.push(plane_sweep(subgroup, true)?),
}
} }
match groups_positions.len() { match groups_positions.len() {
0 => vec![], 0 => vec![],