Cosmetic improvements

This commit is contained in:
RunasSudo 2020-10-17 23:09:29 +11:00
parent b3e03c2f7b
commit fa18641462
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 5 additions and 4 deletions

View File

@ -91,7 +91,7 @@ class STVCCounter:
if len(has_surplus) > 0:
# Distribute surpluses in order of size
has_surplus.sort(lambda x: x[1].votes, True)
candidate, count_card = has_surplus[0]
candidate_surplus, count_card = has_surplus[0]
count_card.state = CandidateState.ELECTED
__pragma__('opov')
@ -119,7 +119,7 @@ class STVCCounter:
self.elect_meeting_quota()
return CountStepResult(
'Surplus',
'Surplus of ' + candidate_surplus.name,
self.candidates,
self.exhausted,
self.quota
@ -131,7 +131,7 @@ class STVCCounter:
hopefuls.sort(lambda x: x[1].votes)
# TODO: Handle ties
candidate, count_card = hopefuls[0]
candidate_excluded, count_card = hopefuls[0]
count_card.state = CandidateState.EXCLUDED
__pragma__('opov')
count_card.transfers -= count_card.votes
@ -155,7 +155,7 @@ class STVCCounter:
self.elect_meeting_quota()
return CountStepResult(
'Exclusion',
'Exclusion of ' + candidate_excluded.name,
self.candidates,
self.exhausted,
self.quota

View File

@ -38,6 +38,7 @@
// Initialise table rows
let tblResults = document.getElementById('result');
tblResults.innerHTML = '';
let candMap = new Map(); // Map Candidate -> rows
// Comment row