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

View File

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