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
+2 -1
View File
@@ -3,6 +3,7 @@ module Dodge.Bullet (
useAmmoParams,
) where
import Data.Foldable
import Data.Maybe
import Dodge.Base.Coordinate
import Dodge.Creature.HandPos
@@ -39,7 +40,7 @@ mvBullet x w bu
applyMagnetsToBul :: Bullet -> World -> Bullet
applyMagnetsToBul bu =
foldr (\mg -> doMagnetBuBu (_mgField mg) mg) bu . _magnets . _cWorld
foldl' (flip doMagnetBuBu) bu . _magnets . _cWorld
updateBulVel :: Bullet -> Bullet
updateBulVel bt = case _buTrajectory bt of