make affection strict

nek0 2 years ago
parent e720c217a0
commit f9af9404d5
  1. 6
      affection/src/Affection.hs

@ -1,5 +1,5 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
@ -111,9 +111,9 @@ withAffection AffectionConfig{..} = do
now <- liftIO $ getTime Monotonic
let lastTime = sysTime ad
-- compute dt and update elapsedTime
let !dt = fromIntegral
let dt = fromIntegral
(toNanoSecs $ diffTimeSpec lastTime now) / (10 ^ (9 :: Int))
!ne = elapsedTime ad + dt
ne = elapsedTime ad + dt
-- update state data object with new time values
put $ ad
{ elapsedTime = ne

Loading…
Cancel
Save