diff options
author | Joey Hess <joey@kitenet.net> | 2012-02-13 16:59:00 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-02-13 16:59:00 -0400 |
commit | 0ef6d86873f55e487be5660a9bb24cb767a06993 (patch) | |
tree | c85cae3f05c8d7fb6df390f8bf4b57d6ed25e838 | |
parent | 59b2adea4f006a391da5210394187f867c3e696b (diff) |
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.
-rw-r--r-- | CmdLine.hs | 4 |
1 files changed, 3 insertions, 1 deletions
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 |