From: Joey Hess Date: Tue, 15 Jun 2021 14:48:11 +0000 (-0400) Subject: avoid nub X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~91^2~224 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=77517ab506b54ab8d0eb172520209d8d0fa7326e;p=git-annex.git avoid nub It's O(N^2) which could matter when there are many dup files using the same key. --- diff --git a/Annex/Drop.hs b/Annex/Drop.hs index 416ce49e94..da7dad2d19 100644 --- 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