Fix bug with attempted bulk exclusion during exclusion of doomed candidates

This commit is contained in:
RunasSudo 2021-08-02 00:24:41 +10:00
parent ea8c452737
commit a2915b034b
No known key found for this signature in database
GPG Key ID: 7234E476BF21C61A
1 changed files with 2 additions and 1 deletions

View File

@ -995,7 +995,8 @@ fn can_bulk_elect<N: Number>(state: &CountState<N>, num_to_exclude: usize) -> bo
let num_hopefuls = state.election.candidates.iter() let num_hopefuls = state.election.candidates.iter()
.filter(|c| { .filter(|c| {
let cc = &state.candidates[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(); .count();