newtype Group to ByteString
This may speed up queries for things in groups, due to Eq and Ord being faster.
This commit is contained in:
parent
3f7fe1d325
commit
6f66b53a30
10 changed files with 69 additions and 48 deletions
4
Limit.hs
4
Limit.hs
|
@ -169,7 +169,7 @@ limitCopies want = case splitc ':' want of
|
|||
-- level, it's parsed as a trust level, not as a group.
|
||||
[v, n] -> case parsetrustspec v of
|
||||
Just checker -> go n $ checktrust checker
|
||||
Nothing -> go n $ checkgroup v
|
||||
Nothing -> go n $ checkgroup (toGroup v)
|
||||
[n] -> go n $ const $ return True
|
||||
_ -> Left "bad value for copies"
|
||||
where
|
||||
|
@ -237,7 +237,7 @@ addInAllGroup groupname = addLimit $ limitInAllGroup groupMap groupname
|
|||
limitInAllGroup :: Annex GroupMap -> MkLimit Annex
|
||||
limitInAllGroup getgroupmap groupname = Right $ \notpresent mi -> do
|
||||
m <- getgroupmap
|
||||
let want = fromMaybe S.empty $ M.lookup groupname $ uuidsByGroup m
|
||||
let want = fromMaybe S.empty $ M.lookup (toGroup groupname) $ uuidsByGroup m
|
||||
if S.null want
|
||||
then return True
|
||||
-- optimisation: Check if a wanted uuid is notpresent.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue