From b01a63ef62dbf46d997910cff30b0bca4f19e99c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 27 Aug 2024 15:00:10 -0400 Subject: [PATCH] avoid nub There will not usually be many live changes, but usually does not mean ever, and O(N^2) is best avoided. --- Database/RepoSize.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Database/RepoSize.hs b/Database/RepoSize.hs index d25ca5374b..c1f1e98d51 100644 --- a/Database/RepoSize.hs +++ b/Database/RepoSize.hs @@ -355,7 +355,8 @@ liveRepoOffsets :: RepoSizeHandle -> IO (M.Map UUID SizeOffset) liveRepoOffsets (RepoSizeHandle (Just h)) = H.queryDb h $ do sizechanges <- getSizeChanges livechanges <- getLiveSizeChanges - let us = nub (M.keys sizechanges ++ M.keys livechanges) + let us = S.toList $ S.fromList $ + M.keys sizechanges ++ M.keys livechanges M.fromList <$> forM us (go sizechanges livechanges) where go sizechanges livechanges u = do