summaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-14 17:43:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-14 17:43:34 -0400
commit60ab3d84e188b8dd3a284d962df25bbee41ff1cb (patch)
tree768d4f632bab0152dbc1ca72f81fc3b9c7915c0a /Command/Unused.hs
parenta4f72c9625486786a4549cf4db1b542ea89da7c7 (diff)
added ifM and nuked 11 lines of code
no behavior changes
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index b878ab265..246929f71 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -299,11 +299,11 @@ staleKeysPrune dirspec = do
staleKeys :: (Git.Repo -> FilePath) -> Annex [Key]
staleKeys dirspec = do
dir <- fromRepo dirspec
- exists <- liftIO $ doesDirectoryExist dir
- if not exists
- then return []
- else do
+ ifM (liftIO $ doesDirectoryExist dir)
+ ( do
contents <- liftIO $ getDirectoryContents dir
files <- liftIO $ filterM doesFileExist $
map (dir </>) contents
return $ mapMaybe (fileKey . takeFileName) files
+ , return []
+ )