Replace some foldr with foldl'

This commit is contained in:
2022-08-23 15:40:15 +01:00
parent 12ce2365c2
commit 9f00e67298
11 changed files with 35 additions and 30 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ damageDirection ds = do
safeArgV (_dmTo dm -.- _dmFrom dm)
collectDamageTypes :: [Damage] -> M.Map DamageType Int
collectDamageTypes = foldr f M.empty
collectDamageTypes = foldl' (flip f) M.empty
where
f dm = M.insertWith (+) (_dmType dm) (_dmAmount dm)