summaryrefslogtreecommitdiff
path: root/Command/DropUnused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-15 12:47:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-15 12:47:14 -0400
commit6c396a256c93464d726c66a95132536941871ee8 (patch)
tree7f934c9eae22a9cfd3fb1672ebd7bf6870439c81 /Command/DropUnused.hs
parent185f0b687081f47d059cc0503f4f6b671868f753 (diff)
finished hlint pass
Diffstat (limited to 'Command/DropUnused.hs')
-rw-r--r--Command/DropUnused.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index 55007c1f7..a01e08ab5 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -49,7 +49,7 @@ start (unused, unusedbad, unusedtmp) s = notBareRepo $ search
]
where
search [] = stop
- search ((m, a):rest) = do
+ search ((m, a):rest) =
case M.lookup s m of
Nothing -> search rest
Just key -> do
@@ -78,10 +78,9 @@ readUnusedLog prefix = do
let f = gitAnnexUnusedLog prefix g
e <- liftIO $ doesFileExist f
if e
- then do
- l <- liftIO $ readFile f
- return $ M.fromList $ map parse $ lines l
- else return $ M.empty
+ then return . M.fromList . map parse . lines
+ =<< liftIO (readFile f)
+ else return M.empty
where
parse line = (head ws, fromJust $ readKey $ unwords $ tail ws)
where