summaryrefslogtreecommitdiff
path: root/RemoteLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-15 03:12:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-15 03:12:05 -0400
commite78475737636a5d1e0d0a36b475c300cc7bb56cc (patch)
tree1d88de569e951b66ff5321eefaec49ad4b33bf89 /RemoteLog.hs
parent9bb797c0eae3c9d2f119a734762a6d5fa7321a80 (diff)
hlint tweaks
Did all sources except Remotes/* and Command/*
Diffstat (limited to 'RemoteLog.hs')
-rw-r--r--RemoteLog.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/RemoteLog.hs b/RemoteLog.hs
index c2065db9d..69a82f498 100644
--- a/RemoteLog.hs
+++ b/RemoteLog.hs
@@ -36,7 +36,7 @@ configSet u c = do
Branch.change remoteLog $ unlines $ sort $
map toline $ M.toList $ M.insert u c m
where
- toline (u', c') = u' ++ " " ++ (unwords $ configToKeyVal c')
+ toline (u', c') = u' ++ " " ++ unwords (configToKeyVal c')
{- Map of remotes by uuid containing key/value config maps. -}
readRemoteLog :: Annex (M.Map UUID RemoteConfig)
@@ -44,14 +44,14 @@ readRemoteLog = return . remoteLogParse =<< Branch.get remoteLog
remoteLogParse :: String -> M.Map UUID RemoteConfig
remoteLogParse s =
- M.fromList $ catMaybes $ map parseline $ filter (not . null) $ lines s
+ M.fromList $ mapMaybe parseline $ filter (not . null) $ lines s
where
parseline l
| length w > 2 = Just (u, c)
| otherwise = Nothing
where
w = words l
- u = w !! 0
+ u = head w
c = keyValToConfig $ tail w
{- Given Strings like "key=value", generates a RemoteConfig. -}
@@ -90,8 +90,8 @@ configUnEscape = unescape
r = drop (length num) s
rest = drop 1 r
ok = not (null num) &&
- not (null r) && r !! 0 == ';'
+ not (null r) && head r == ';'
{- for quickcheck -}
prop_idempotent_configEscape :: String -> Bool
-prop_idempotent_configEscape s = s == (configUnEscape $ configEscape s)
+prop_idempotent_configEscape s = s == (configUnEscape . configEscape) s