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
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

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()
.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();