[Git][ghc/ghc][master] Use foldl' in unionManyUniqDSets

Marge Bot gitlab at gitlab.haskell.org
Mon Jun 15 17:10:09 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
9a9cc089 by Simon Jakobi at 2020-06-15T13:10:00-04:00
Use foldl' in unionManyUniqDSets

- - - - -


1 changed file:

- compiler/GHC/Types/Unique/DSet.hs


Changes:

=====================================
compiler/GHC/Types/Unique/DSet.hs
=====================================
@@ -81,8 +81,8 @@ unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
 unionUniqDSets (UniqDSet s) (UniqDSet t) = UniqDSet (plusUDFM s t)
 
 unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a
-unionManyUniqDSets [] = emptyUniqDSet
-unionManyUniqDSets sets = foldr1 unionUniqDSets sets
+unionManyUniqDSets []     = emptyUniqDSet
+unionManyUniqDSets (x:xs) = foldl' unionUniqDSets x xs
 
 minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a
 minusUniqDSet (UniqDSet s) (UniqDSet t) = UniqDSet (minusUDFM s t)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9a9cc0897b676ffd6612562a46600ea98c53a58d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9a9cc0897b676ffd6612562a46600ea98c53a58d
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200615/0fb6630b/attachment.html>


More information about the ghc-commits mailing list