bloomfilter 1.2.6.3 → 1.2.6.4
raw patch · 3 files changed
+14/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/BloomFilter.hs +8/−2
- Data/BloomFilter/Hash.hs +5/−4
- bloomfilter.cabal +1/−1
Data/BloomFilter.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE BangPatterns, Rank2Types, TypeOperators #-}+{-# LANGUAGE BangPatterns, CPP, Rank2Types, TypeOperators #-} {-# OPTIONS_GHC -fglasgow-exts #-} -- |@@ -87,6 +87,8 @@ , bitArrayMB ) where +#include "MachDeps.h"+ import Control.Monad (liftM, forM_) import Control.Monad.ST (ST, runST) import Control.Parallel.Strategies (NFData(..))@@ -164,7 +166,11 @@ isPowerOfTwo n = n .&. (n - 1) == 0 maxHash :: Int-maxHash = 4294967296 -- fromIntegral (maxBound :: Hash)+#if WORD_SIZE_IN_BITS == 64+maxHash = 4294967296+#else+maxHash = 2147483648+#endif logBitsInHash :: Int logBitsInHash = 5 -- logPower2 bitsInHash
Data/BloomFilter/Hash.hs view
@@ -143,11 +143,12 @@ {-# SPECIALIZE cheapHashes :: Int -> String -> [Word32] #-} cheapHashes k v = go 0 where go i | i == j = []- | otherwise = h1 + (h2 `shiftR` i) : go (i + 1)- !h1 = fromIntegral (h `shiftR` 32) .&. maxBound- !h2 = fromIntegral h+ | otherwise = hash : go (i + 1)+ where !hash = h1 + (h2 `shiftR` i)+ h1 = fromIntegral (h `shiftR` 32)+ h2 = fromIntegral h h = hashSalt64 0x9150a946c4a8966e v- j = fromIntegral k - 1+ j = fromIntegral k instance Hashable () where hashIO32 _ salt = return salt
bloomfilter.cabal view
@@ -1,5 +1,5 @@ name: bloomfilter-version: 1.2.6.3+version: 1.2.6.4 license: BSD3 license-file: LICENSE author: Bryan O'Sullivan <bos@serpentine.com>