summaryrefslogtreecommitdiff
path: root/LocationLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-15 15:27:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-15 15:27:49 -0400
commit6aab88fa251a14fbf31c7a8d80296c78db0ed048 (patch)
tree34465a5c706ab825ecd34b9261ecc6f35e4dd555 /LocationLog.hs
parent1e5beda86a1d0185466547bd1acb61a75ac66992 (diff)
more monadic operator use
Diffstat (limited to 'LocationLog.hs')
-rw-r--r--LocationLog.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/LocationLog.hs b/LocationLog.hs
index 6759b47fe..b2d423cf9 100644
--- a/LocationLog.hs
+++ b/LocationLog.hs
@@ -150,16 +150,13 @@ mapLog m l =
then Map.insert u l m
else m
where
- better = case Map.lookup u m of
- Just l' -> (date l' <= date l)
- Nothing -> True
+ better = maybe True (\l' -> date l' <= date l) $ Map.lookup u m
u = uuid l
{- Finds all keys that have location log information.
- (There may be duplicate keys in the list.) -}
loggedKeys :: Git.Repo -> IO [Key]
loggedKeys repo = do
- let dir = gitStateDir repo
exists <- doesDirectoryExist dir
if exists
then do
@@ -172,3 +169,4 @@ loggedKeys repo = do
else return []
where
tryDirContents d = catch (dirContents d) (return . const [])
+ dir = gitStateDir repo