Replace some foldr with foldl'
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user