This commit is contained in:
Joey Hess 2011-10-31 16:46:51 -04:00
parent 00988bcf36
commit 3d2a9f8405
11 changed files with 48 additions and 54 deletions

View file

@ -67,7 +67,9 @@ findByName name = do
return (uuid, M.insert nameKey name M.empty)
findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
findByName' n m = if null matches then Nothing else Just $ head matches
findByName' n m
| null matches = Nothing
| otherwise = Just $ head matches
where
matches = filter (matching . snd) $ M.toList m
matching c = case M.lookup nameKey c of