Remove unnecessary zeroes check

This commit is contained in:
Joscha 2018-09-20 17:13:37 +00:00
parent bb7722399e
commit f50a25ea3b

View file

@ -150,9 +150,7 @@ wordsLeft = classMapWordCount . possibleWords
worstCase :: Class -> M.Map Class Int -> Int worstCase :: Class -> M.Map Class Int -> Int
worstCase c cmap = worstCase c cmap =
let solutions = M.mapKeysWith (+) (score c) cmap let solutions = M.mapKeysWith (+) (score c) cmap
zeroes = M.fromList $ zip [1..S.size c] (repeat 0) maxHitCount = maximum solutions
solutionsWithZeroes = M.union solutions zeroes
maxHitCount = maximum solutionsWithZeroes
minEliminated = M.size cmap - maxHitCount minEliminated = M.size cmap - maxHitCount
in minEliminated in minEliminated