diff options
author | Joey Hess <joey@kitenet.net> | 2011-08-30 13:23:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-08-30 13:23:21 -0400 |
commit | a64c16bf7d6cf3ba5295a23496e10ed70c1656dc (patch) | |
tree | 0992823d20075951b74bf37a782a36f312a56f92 /Backend.hs | |
parent | 5ef11350aafe2aec48f66799743423a9c6e42556 (diff) |
tweak
Diffstat (limited to 'Backend.hs')
-rw-r--r-- | Backend.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Backend.hs b/Backend.hs index 0bb9f4b57..75327de80 100644 --- a/Backend.hs +++ b/Backend.hs @@ -122,8 +122,7 @@ lookupBackendName s = fromMaybe unknown $ maybeLookupBackendName s where unknown = error $ "unknown backend " ++ s maybeLookupBackendName :: String -> Maybe (Backend Annex) -maybeLookupBackendName s = - if 1 /= length matches - then Nothing - else Just $ head matches +maybeLookupBackendName s + | length matches == 1 = Just $ head matches + | otherwise = Nothing where matches = filter (\b -> s == B.name b) list |