X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/6dfbfbec4b0d01138c272649d668c5a872706a5c..07800d892d8454c16d75ddc35cd36e630498aab0:/lib/rubyvote/condorcet.rb diff --git a/lib/rubyvote/condorcet.rb b/lib/rubyvote/condorcet.rb index 65c664d..aaa5044 100644 --- a/lib/rubyvote/condorcet.rb +++ b/lib/rubyvote/condorcet.rb @@ -184,7 +184,10 @@ class PureCondorcetResult < CondorcetResult def condorcet votes = @election.votes candidates = @election.candidates - + unless votes.length>0 and candidates.length>0 + @winners=[] + return @winners + end victors = Hash.new candidates.each do |candidate| victors[candidate] = Array.new @@ -214,6 +217,7 @@ class CloneproofSSDResult < CondorcetResult def initialize(voteobj=nil) super(voteobj) @winners = self.cpssd() + @winners.delete nil end protected