X-Git-Url: https://projects.mako.cc/source/rubyvote/blobdiff_plain/1723e5c01789f5240a148a4671492de6a7438abd..ad05e67f416f8e1c9fb5de1d015fc057ee85961d:/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