From: John Dong Date: Wed, 15 Aug 2007 20:17:33 +0000 (-0400) Subject: Merge head X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/389db6f5756bc8a2063f4ab786ea71b4c3b53b8f?hp=343bc338d381da77f55b0231316c237c7502cbc2 Merge head --- diff --git a/lib/rubyvote/condorcet.rb b/lib/rubyvote/condorcet.rb index c0539ab..0b7a306 100644 --- 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 - @winners=[nil] + @winners=[] return @winners end victors = Hash.new @@ -224,7 +224,7 @@ class CloneproofSSDResult < CondorcetResult def cpssd votes = @election.votes candidates = *@election.candidates - + def in_schwartz_set?(candidate, candidates, transitive_defeats) candidates.each do |challenger| next if candidate == challenger diff --git a/lib/rubyvote/election.rb b/lib/rubyvote/election.rb index b9bb557..42f18bb 100644 --- a/lib/rubyvote/election.rb +++ b/lib/rubyvote/election.rb @@ -133,7 +133,7 @@ class ElectionResult end def winner? - @winners.length > 0 + @winners.length > 0 and not @winners[0].nil? end end diff --git a/lib/rubyvote/irv.rb b/lib/rubyvote/irv.rb index b26b1d1..c3fabe6 100644 --- a/lib/rubyvote/irv.rb +++ b/lib/rubyvote/irv.rb @@ -88,7 +88,7 @@ class InstantRunoffResult < ElectionResult end unless votes.length > 0 - @winners=[nil] + @winners=[] return end