From 77517ab506b54ab8d0eb172520209d8d0fa7326e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2021 10:48:11 -0400 Subject: [PATCH] avoid nub It's O(N^2) which could matter when there are many dup files using the same key. --- Annex/Drop.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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