projects
/
selectricity
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge head
[selectricity]
/
lib
/
rubyvote
/
irv.rb
diff --git
a/lib/rubyvote/irv.rb
b/lib/rubyvote/irv.rb
index 38517381e2591770188aec70abec6f2d147adf61..c3fabe6e488de75352c1ae53305e0a1b0785022c 100644
(file)
--- a/
lib/rubyvote/irv.rb
+++ b/
lib/rubyvote/irv.rb
@@
-87,6
+87,11
@@
class InstantRunoffResult < ElectionResult
apply_retention(votes, votes_sum * params['percent_retention'])
end
+ unless votes.length > 0
+ @winners=[]
+ return
+ end
+
begin
ranked_candidates = votes.sort do |a, b|
b[1][0] <=> a[1][0]
Benjamin Mako Hill
||
Want to submit a patch?