Skip to content

Commit

Permalink
Fix a space leak when writing out duplicate types
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Sep 16, 2015
1 parent 4aa7430 commit 102966e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Output/Types.hs
Expand Up @@ -151,7 +151,7 @@ writeDuplicates :: Ord a => StoreWrite -> [(TargetId, Sig a)] -> IO [Sig a]
writeDuplicates store xs = do
-- s=signature, t=targetid, p=popularity (incoing index), i=index (outgoing index)
xs <- return $ map (second snd) $ sortOn (fst . snd) $ Map.toList $
Map.fromListWith (\(x1,x2) (y1,y2) -> (min x1 y1, x2 ++ y2)) [(s,(p,[t])) | (p,(t,s)) <- zip [0::Int ..] xs]
Map.fromListWith (\(!x1,x2) (!y1,y2) -> (min x1 y1, x2 ++ y2)) [(s,(p,[t])) | (p,(t,s)) <- zip [0::Int ..] xs]
-- give a list of TargetId's at each index
storeWrite store TypesDuplicates $ jaggedFromList $ map (reverse . snd) xs
return $ map fst xs
Expand Down

0 comments on commit 102966e

Please sign in to comment.