From ffb200c7e955c9c460ce875ce2ebb73b60ea3c3f Mon Sep 17 00:00:00 2001 From: Jack Wines Date: Thu, 6 Jul 2023 20:09:05 -0700 Subject: [PATCH] fix empty empty notVotedForCandidates problem --- src/InstantRunoff.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InstantRunoff.hs b/src/InstantRunoff.hs index de6d7bc..b611779 100644 --- a/src/InstantRunoff.hs +++ b/src/InstantRunoff.hs @@ -7,7 +7,7 @@ import qualified Data.Maybe as M import qualified Data.Ord as O solve :: forall a. Ord a => [a] -> LN.NonEmpty (LN.NonEmpty a) -> [S.Set a] -solve candidates votes = (reverse solved) ++ [notVotedForCandidates] +solve candidates votes = (reverse solved) ++ if (S.null notVotedForCandidates) then [] else [notVotedForCandidates] where -- candidates not on any submitted ballot