aboutsummaryrefslogtreecommitdiff
path: root/Annex/NumCopies.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-30 14:11:29 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-30 14:11:59 -0400
commit9751908b69f166ad26183b7d3cdd3b0fb7b3830a (patch)
treef66a01c5145ff704cc862dc67c320e95368d8219 /Annex/NumCopies.hs
parentee8845d48d6e70424a7dd65e45d5d2aaba5edab1 (diff)
move nubbing into function whose algo needs a nubbed list
Diffstat (limited to 'Annex/NumCopies.hs')
-rw-r--r--Annex/NumCopies.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Annex/NumCopies.hs b/Annex/NumCopies.hs
index 62cd93883..879513927 100644
--- a/Annex/NumCopies.hs
+++ b/Annex/NumCopies.hs
@@ -99,7 +99,8 @@ verifyEnoughCopies
-> [UUID] -- repos that are trusted or already verified to have it
-> [Remote] -- remotes to check to see if they have it
-> Annex Bool
-verifyEnoughCopies nolocmsg key need skip = helper [] []
+verifyEnoughCopies nolocmsg key need skip trusted tocheck =
+ helper [] [] (nub trusted) (nub tocheck)
where
helper bad missing have []
| NumCopies (length have) >= need = return True
@@ -140,7 +141,7 @@ knownCopies key = do
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
u <- getUUID
trusteduuids' <- ifM (inAnnex key <&&> (<= SemiTrusted) <$> lookupTrust u)
- ( pure (nub (u:trusteduuids))
+ ( pure (u:trusteduuids)
, pure trusteduuids
)
return (remotes, trusteduuids')