short-circuit as soon as enough remotes are verified to have a file
This commit is contained in:
parent
eea140c90d
commit
68e2687661
1 changed files with 8 additions and 5 deletions
|
@ -111,11 +111,14 @@ checkRemoveKey key = do
|
||||||
then return True
|
then return True
|
||||||
else notEnoughCopies need have bad
|
else notEnoughCopies need have bad
|
||||||
findcopies need have (r:rs) bad = do
|
findcopies need have (r:rs) bad = do
|
||||||
haskey <- Remotes.inAnnex r key
|
if (have >= need)
|
||||||
case (haskey) of
|
then return True
|
||||||
Right True -> findcopies need (have+1) rs bad
|
else do
|
||||||
Right False -> findcopies need have rs bad
|
haskey <- Remotes.inAnnex r key
|
||||||
Left _ -> findcopies need have rs (r:bad)
|
case (haskey) of
|
||||||
|
Right True -> findcopies need (have+1) rs bad
|
||||||
|
Right False -> findcopies need have rs bad
|
||||||
|
Left _ -> findcopies need have rs (r:bad)
|
||||||
notEnoughCopies need have bad = do
|
notEnoughCopies need have bad = do
|
||||||
unsafe
|
unsafe
|
||||||
showLongNote $
|
showLongNote $
|
||||||
|
|
Loading…
Reference in a new issue