summaryrefslogtreecommitdiffhomepage
path: root/Replay.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-27 10:29:33 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-27 10:29:33 -0400
commit952cc2941091518e61345f005b6e218bc34f75ec (patch)
treec5130b0dc4733f96b0855321919fe508b6d15fdc /Replay.hs
parent937b55549b4ba72b0392d7e139e592a40eec2101 (diff)
downloaddebug-me-952cc2941091518e61345f005b6e218bc34f75ec.tar.gz
don't need Maybe ElapsedTime
Make it a monoid and use mempty = 0
Diffstat (limited to 'Replay.hs')
-rw-r--r--Replay.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Replay.hs b/Replay.hs
index 8d2e3ae..c2c520e 100644
--- a/Replay.hs
+++ b/Replay.hs
@@ -15,7 +15,7 @@ replay opts = go =<< streamLog (replayLogFile opts)
go (Right l:ls) = do
case loggedMessage l of
User (ActivityMessage a) -> do
- maybe (return ()) realisticDelay (elapsedTime a)
+ realisticDelay (elapsedTime a)
B.hPut stdout $ val $ seenData $ activity a
hFlush stdout
User (ControlMessage _) -> return ()
@@ -24,4 +24,6 @@ replay opts = go =<< streamLog (replayLogFile opts)
go (Left l:_) = error $ "Failed to parse a line of the log: " ++ l
realisticDelay :: ElapsedTime -> IO ()
-realisticDelay (ElapsedTime n) = delay $ ceiling $ n * 1000000
+realisticDelay (ElapsedTime n)
+ | n < 1 = return ()
+ | otherwise = delay $ ceiling $ n * 1000000