summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-07-07 12:28:11 +1000
committerJed Barber <jjbarber@y7mail.com>2017-07-07 12:28:11 +1000
commitb42d2adc9de06d4ccc31874ea86c4ded3152af1d (patch)
tree4face7f920e2559144f32747f0f78811bc90b579
parent1adf30f4a855256e8720d25d027ad89f3ff49e15 (diff)
Ensured that Exclude_Candidates won't exclude so many that the remaining vacancies can't be filled
-rw-r--r--src/election.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/election.adb b/src/election.adb
index 7e825b3..ddbdb26 100644
--- a/src/election.adb
+++ b/src/election.adb
@@ -556,8 +556,8 @@ package body Election is
for R in Running.Iterate loop
Votes_To_Be_Excluded := Running.Reference (R).Total_Votes;
- exit when Number_Excluded > 0 and
- Votes_Excluded + Votes_To_Be_Excluded > Applied_Breakpoint;
+ exit when Integer (Running.Length) - Number_Excluded <= Vacancies + 1 or
+ (Number_Excluded > 0 and Votes_Excluded + Votes_To_Be_Excluded > Applied_Breakpoint);
Working_Position := Running.Reference (R).Index;
Working_ID := Entries.Reference (Working_Position).ID;