projects
/
git-annex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3712b6
)
avoid nub
author
Joey Hess
<joeyh@joeyh.name>
Tue, 15 Jun 2021 14:48:11 +0000
(10:48 -0400)
committer
Joey Hess
<joeyh@joeyh.name>
Tue, 15 Jun 2021 14:48:11 +0000
(10:48 -0400)
It's O(N^2) which could matter when there are many dup files using the
same key.
Annex/Drop.hs
patch
|
blob
|
history
diff --git
a/Annex/Drop.hs
b/Annex/Drop.hs
index 416ce49e949d2d552dc21eda196a52b90eb1e583..da7dad2d198a2bb1be088f3b5d18120840243159 100644
(file)
--- a/
Annex/Drop.hs
+++ b/
Annex/Drop.hs
@@
-55,7
+55,7
@@
handleDropsFrom locs rs reason fromhere key afile si preverified runner = do
l <- map (`fromTopFilePath` g)
<$> Database.Keys.getAssociatedFiles key
let fs = case afile of
- AssociatedFile (Just f) ->
nub (f : l)
+ AssociatedFile (Just f) ->
f : filter (/= f) l
AssociatedFile Nothing -> l
n <- getcopies fs
void $ if fromhere && checkcopies n Nothing