Repository : ssh://[email protected]/containers

On branch  : ghc-head
Link       : 
http://git.haskell.org/?p=packages/containers.git;a=commit;h=de2214f830d9f0c003ba35f2f352e831d5bea7f5

>---------------------------------------------------------------

commit de2214f830d9f0c003ba35f2f352e831d5bea7f5
Author: Nicolas Trangez <[email protected]>
Date:   Sat Sep 15 11:18:08 2012 +0200

    Change bitcount in IntSet to use popCount


>---------------------------------------------------------------

de2214f830d9f0c003ba35f2f352e831d5bea7f5
 Data/IntSet/Base.hs |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Data/IntSet/Base.hs b/Data/IntSet/Base.hs
index 7e7c1a7..8df5911 100644
--- a/Data/IntSet/Base.hs
+++ b/Data/IntSet/Base.hs
@@ -1496,9 +1496,13 @@ foldr'Bits prefix f z bm = let lb = lowestBitSet bm
     Derrick Lehmer and published in 1964 in a book edited by Beckenbach.)"
 ----------------------------------------------------------------------}
 bitcount :: Int -> Word -> Int
+#if MIN_VERSION_base(4,5,0)
+bitcount a x = a + popCount x
+#else
 bitcount a0 x0 = go a0 x0
   where go a 0 = a
         go a x = go (a + 1) (x .&. (x-1))
+#endif
 {-# INLINE bitcount #-}
 
 


_______________________________________________
ghc-commits mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/ghc-commits

Reply via email to