Determine thunk leak when marking seen walls

This commit is contained in:
2021-10-29 17:25:12 +01:00
parent 686a9fc3ee
commit 50d0f18ab7
6 changed files with 26 additions and 32 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ import Control.Lens
damageBlocksBy :: Int -> Wall -> World -> World
damageBlocksBy x wl = case _wlBlockID wl of
Just blid -> blocks . ix blid . blHPs %~ reduceHeadBy x
Nothing -> id
Just' blid -> blocks . ix blid . blHPs %~ reduceHeadBy x
Nothing' -> id
where
reduceHeadBy y (z:zs) = z - y : zs
reduceHeadBy _ [] = []