Attempt to fix some space leaks, general cleanup
This commit is contained in:
@@ -3,6 +3,7 @@ module Dodge.Wall.Delete (
|
||||
deleteWallID,
|
||||
) where
|
||||
|
||||
import Data.Foldable
|
||||
import Control.Lens
|
||||
import qualified Data.IntSet as IS
|
||||
import Dodge.Data.World
|
||||
@@ -24,4 +25,4 @@ deleteWall wl =
|
||||
i = _wlID wl
|
||||
|
||||
deleteWallIDs :: IS.IntSet -> World -> World
|
||||
deleteWallIDs is w = foldr deleteWall w $ IM.restrictKeys (_walls (_cWorld w)) is
|
||||
deleteWallIDs is w = foldl' (flip deleteWall) w $ IM.restrictKeys (_walls (_cWorld w)) is
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module Dodge.Wall.Dust where
|
||||
|
||||
import Data.Foldable
|
||||
import Control.Lens
|
||||
import Dodge.Data.World
|
||||
import Dodge.WorldEvent.Cloud
|
||||
@@ -12,9 +13,9 @@ wlDustAt wl = smokeCloudAt dustcol 20 200 1 . addZ 20
|
||||
dustcol = _wlColor wl & _4 .~ 1
|
||||
|
||||
muchWlDustAt :: Wall -> Point2 -> World -> World
|
||||
muchWlDustAt wl p = flip (foldr f) [10, 20 .. 100]
|
||||
muchWlDustAt wl p = flip (foldl' f) [10, 20 .. 100]
|
||||
where
|
||||
f h w =
|
||||
f w h =
|
||||
w
|
||||
& smokeCloudAt dustcol 20 200 1 (addZ h (p +.+ off))
|
||||
& randGen .~ g
|
||||
|
||||
Reference in New Issue
Block a user