make affection strict
This commit is contained in:
parent
e81408e54f
commit
4a5cc6d0e0
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# LANGUAGE Strict #-}
|
||||||
{-# LANGUAGE ExplicitForAll #-}
|
{-# LANGUAGE ExplicitForAll #-}
|
||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
{-# LANGUAGE RankNTypes #-}
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
@ -111,9 +111,9 @@ withAffection AffectionConfig{..} = do
|
||||||
now <- liftIO $ getTime Monotonic
|
now <- liftIO $ getTime Monotonic
|
||||||
let lastTime = sysTime ad
|
let lastTime = sysTime ad
|
||||||
-- compute dt and update elapsedTime
|
-- compute dt and update elapsedTime
|
||||||
let !dt = fromIntegral
|
let dt = fromIntegral
|
||||||
(toNanoSecs $ diffTimeSpec lastTime now) / (10 ^ (9 :: Int))
|
(toNanoSecs $ diffTimeSpec lastTime now) / (10 ^ (9 :: Int))
|
||||||
!ne = elapsedTime ad + dt
|
ne = elapsedTime ad + dt
|
||||||
-- update state data object with new time values
|
-- update state data object with new time values
|
||||||
put $ ad
|
put $ ad
|
||||||
{ elapsedTime = ne
|
{ elapsedTime = ne
|
||||||
|
|
Loading…
Reference in a new issue