summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-03 09:10:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-03 09:10:23 -0400
commit64672c6262048e9498be667f8dc7460c0a9189e2 (patch)
tree194453dc8731dff8207bbc76bc752ad472c1f795 /Locations.hs
parentb5930f6d076d266b337b415447f448fbb14d9ea3 (diff)
refactor
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs6
1 files changed, 1 insertions, 5 deletions
diff --git a/Locations.hs b/Locations.hs
index 1179886ad..3843495f9 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -89,11 +89,7 @@ gitAnnexLocation key r
annexLocation key hashDirMixed
where
go dir locs = fromMaybe (dir </> head locs) <$> check dir locs
- check _ [] = return Nothing
- check dir (l:ls) = do
- let f = dir </> l
- e <- doesFileExist f
- if e then return (Just f) else check dir ls
+ check dir = firstM $ \f -> doesFileExist $ dir </> f
{- The annex directory of a repository. -}
gitAnnexDir :: Git.Repo -> FilePath