summaryrefslogtreecommitdiff
path: root/Upgrade/V0.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-16 01:59:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-16 01:59:07 -0400
commit184a69171d5d983ee2f08cce28011d235f44cc5c (patch)
treeff85fc620618b55c8cbed0d8c99212e73004f5b5 /Upgrade/V0.hs
parentc0c9991c9f5322aef05f4c97d2c3f3bdc3101e46 (diff)
removed another 10 lines via ifM
Diffstat (limited to 'Upgrade/V0.hs')
-rw-r--r--Upgrade/V0.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/Upgrade/V0.hs b/Upgrade/V0.hs
index c439c7caa..8f3af337e 100644
--- a/Upgrade/V0.hs
+++ b/Upgrade/V0.hs
@@ -35,14 +35,11 @@ lookupFile0 :: FilePath -> Annex (Maybe (Key, Backend))
lookupFile0 = Upgrade.V1.lookupFile1
getKeysPresent0 :: FilePath -> Annex [Key]
-getKeysPresent0 dir = do
- exists <- liftIO $ doesDirectoryExist dir
- if not exists
- then return []
- else do
- contents <- liftIO $ getDirectoryContents dir
- files <- liftIO $ filterM present contents
- return $ map fileKey0 files
+getKeysPresent0 dir = ifM (liftIO $ doesDirectoryExist dir)
+ ( liftIO $ map fileKey0
+ <$> (filterM present =<< getDirectoryContents dir)
+ , return []
+ )
where
present d = do
result <- tryIO $