diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-10 16:23:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-10 16:23:41 -0400 |
commit | fde7c97ffd0ad175918f270571febfc893defd55 (patch) | |
tree | a99b1d1f41e9ca08abee8ed2aaecbb73d5240fd4 /Logs/Group.hs | |
parent | 7053033f7708c2e432b3ad3e62356bd395932899 (diff) |
ui for selecting a repository group
Diffstat (limited to 'Logs/Group.hs')
-rw-r--r-- | Logs/Group.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Logs/Group.hs b/Logs/Group.hs index a58eafe92..56363f857 100644 --- a/Logs/Group.hs +++ b/Logs/Group.hs @@ -68,9 +68,7 @@ makeGroupMap byuuid = GroupMap byuuid bygroup explode (u, s) = map (\g -> (g, S.singleton u)) (S.toList s) {- If a repository is in exactly one standard group, returns it. -} -getStandardGroup :: UUID -> GroupMap -> Maybe StandardGroup -getStandardGroup u m = maybe Nothing go $ u `M.lookup` groupsByUUID m - where - go s = case catMaybes $ map toStandardGroup $ S.toList s of - [g] -> Just g - _ -> Nothing +getStandardGroup :: S.Set Group -> Maybe StandardGroup +getStandardGroup s = case catMaybes $ map toStandardGroup $ S.toList s of + [g] -> Just g + _ -> Nothing |