From f50a25ea3bc99abe2b5fdbfce43b150dcb3b0a7e Mon Sep 17 00:00:00 2001 From: Joscha Date: Thu, 20 Sep 2018 17:13:37 +0000 Subject: [PATCH] Remove unnecessary zeroes check --- src/Jotto.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Jotto.hs b/src/Jotto.hs index 994ba40..ee5ef85 100644 --- a/src/Jotto.hs +++ b/src/Jotto.hs @@ -150,9 +150,7 @@ wordsLeft = classMapWordCount . possibleWords worstCase :: Class -> M.Map Class Int -> Int worstCase c cmap = let solutions = M.mapKeysWith (+) (score c) cmap - zeroes = M.fromList $ zip [1..S.size c] (repeat 0) - solutionsWithZeroes = M.union solutions zeroes - maxHitCount = maximum solutionsWithZeroes + maxHitCount = maximum solutions minEliminated = M.size cmap - maxHitCount in minEliminated