From 0ef6d86873f55e487be5660a9bb24cb767a06993 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 Feb 2012 16:59:00 -0400 Subject: force state strictly When converting to the strict state monad, I missed this place where thunks to the state could be built up, possibly. This seems to make it run in some percentage less memory. --- CmdLine.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs index 18bb5fe51..d2adb71bb 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -71,7 +71,9 @@ tryRun' :: Integer -> Annex.AnnexState -> Command -> [CommandCleanup] -> IO () tryRun' errnum _ cmd [] | errnum > 0 = error $ cmdname cmd ++ ": " ++ show errnum ++ " failed" | otherwise = return () -tryRun' errnum state cmd (a:as) = run >>= handle +tryRun' errnum state cmd (a:as) = do + r <- run + handle $! r where run = tryIO $ Annex.run state $ do Annex.Queue.flushWhenFull -- cgit v1.2.3