From ad05e67f416f8e1c9fb5de1d015fc057ee85961d Mon Sep 17 00:00:00 2001 From: John Dong Date: Wed, 15 Aug 2007 20:27:12 +0000 Subject: [PATCH] Work around CloneProofSSD returning [nil] rather than [] for empty vote git-svn-id: svn://rubyforge.org/var/svn/rubyvote/trunk@37 1440c7f4-e209-0410-9a04-881b5eb134a8 --- lib/rubyvote/condorcet.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rubyvote/condorcet.rb b/lib/rubyvote/condorcet.rb index 0b7a306..aaa5044 100644 --- a/lib/rubyvote/condorcet.rb +++ b/lib/rubyvote/condorcet.rb @@ -217,6 +217,7 @@ class CloneproofSSDResult < CondorcetResult def initialize(voteobj=nil) super(voteobj) @winners = self.cpssd() + @winners.delete nil end protected @@ -224,7 +225,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 -- 2.30.2