Permalink
Browse files

Fix a space leak when writing out duplicate types

  • Loading branch information...
ndmitchell committed Sep 16, 2015
1 parent 4aa7430 commit 102966ec2b7917e0f4411e94280bd549e3e93878
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Output/Types.hs
View
@@ -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

0 comments on commit 102966e

Please sign in to comment.