From a2915b034bc2099a611c927ddcb4589e12fbb904 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Mon, 2 Aug 2021 00:24:41 +1000 Subject: [PATCH] Fix bug with attempted bulk exclusion during exclusion of doomed candidates --- src/stv/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stv/mod.rs b/src/stv/mod.rs index 056fe46..ee8bca9 100644 --- a/src/stv/mod.rs +++ b/src/stv/mod.rs @@ -995,7 +995,8 @@ fn can_bulk_elect(state: &CountState, num_to_exclude: usize) -> bo let num_hopefuls = state.election.candidates.iter() .filter(|c| { let cc = &state.candidates[c]; - return cc.state == CandidateState::Hopeful || cc.state == CandidateState::Guarded; + // Include doomed candidates here as these are included in num_to_exclude and so will later be subtracted + return cc.state == CandidateState::Hopeful || cc.state == CandidateState::Guarded || cc.state == CandidateState::Doomed; }) .count();