avoid nub
There will not usually be many live changes, but usually does not mean ever, and O(N^2) is best avoided.
This commit is contained in:
parent
0a119184e6
commit
b01a63ef62
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue