From ae1b10889b53eeabc3a1f2281cfc1555781ab7fb Mon Sep 17 00:00:00 2001 From: John Dong Date: Wed, 15 Aug 2007 16:17:11 -0400 Subject: [PATCH] Pull in svn Rubyvote again --- lib/rubyvote/condorcet.rb | 4 ++-- lib/rubyvote/election.rb | 2 +- lib/rubyvote/irv.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.30.2