projects
/
rubyvote
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
formatting fixes
[rubyvote]
/
lib
/
rubyvote
/
condorcet.rb
diff --git
a/lib/rubyvote/condorcet.rb
b/lib/rubyvote/condorcet.rb
index 715399566e270db367d311c9a26d2f7c08fd1bcf..08fd2dfed617dcb36baf253aec7960abdf5d7041 100644
(file)
--- a/
lib/rubyvote/condorcet.rb
+++ b/
lib/rubyvote/condorcet.rb
@@
-208,10
+208,11
@@
class PureCondorcetResult < CondorcetResult
def condorcet
votes = @election.votes
candidates = @election.candidates
def condorcet
votes = @election.votes
candidates = @election.candidates
- unless votes.length>0 and candidates.length>0
- @winners=[]
- return @winners
+
+ unless votes.length > 0 and candidates.length > 0
+ return @winners
=[]
end
end
+
victors = Hash.new
candidates.each do |candidate|
victors[candidate] = Array.new
victors = Hash.new
candidates.each do |candidate|
victors[candidate] = Array.new
Benjamin Mako Hill
||
Want to submit a patch?