projects
/
rubyvote
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Work around CloneProofSSD returning [nil] rather than [] for empty vote
[rubyvote]
/
lib
/
rubyvote
/
condorcet.rb
diff --git
a/lib/rubyvote/condorcet.rb
b/lib/rubyvote/condorcet.rb
index c0539abea5f02aa5b11ddda80fd41f68e78b9b8e..aaa504477373e07735b6eab9b7c847db0c68232a 100644
(file)
--- a/
lib/rubyvote/condorcet.rb
+++ b/
lib/rubyvote/condorcet.rb
@@
-185,7
+185,7
@@
class PureCondorcetResult < CondorcetResult
votes = @election.votes
candidates = @election.candidates
unless votes.length>0 and candidates.length>0
votes = @election.votes
candidates = @election.candidates
unless votes.length>0 and candidates.length>0
- @winners=[
nil
]
+ @winners=[]
return @winners
end
victors = Hash.new
return @winners
end
victors = Hash.new
@@
-217,6
+217,7
@@
class CloneproofSSDResult < CondorcetResult
def initialize(voteobj=nil)
super(voteobj)
@winners = self.cpssd()
def initialize(voteobj=nil)
super(voteobj)
@winners = self.cpssd()
+ @winners.delete nil
end
protected
end
protected
Benjamin Mako Hill
||
Want to submit a patch?