Work around CloneProofSSD returning [nil] rather than [] for empty vote
[rubyvote] / lib / rubyvote / condorcet.rb
index c0539abea5f02aa5b11ddda80fd41f68e78b9b8e..aaa504477373e07735b6eab9b7c847db0c68232a 100644 (file)
@@ -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
@@ -217,6 +217,7 @@ class CloneproofSSDResult < CondorcetResult
   def initialize(voteobj=nil)
     super(voteobj)
     @winners = self.cpssd()
+    @winners.delete nil
   end
 
   protected

Benjamin Mako Hill || Want to submit a patch?