Skip to content

Commit 56739e4

Browse files
committed
Make bitsPerSubkey platform-dependent
1 parent 5385b0c commit 56739e4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Data/HashMap/Internal.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,12 +1558,6 @@ submapBitmapIndexed comp !b1 !ary1 !b2 !ary2 = subsetBitmaps && go 0 0 (b1Orb2 .
15581558
go !i !j !m
15591559
| m > b1Orb2 = True
15601560

1561-
#if WORD_SIZE_IN_BITS == 32
1562-
-- m can overflow to 0 on 32-bit platforms.
1563-
-- See #491.
1564-
| m == 0 = True
1565-
#endif
1566-
15671561
-- In case a key is both in ary1 and ary2, check ary1[i] <= ary2[j] and
15681562
-- increment the indices i and j.
15691563
| b1Andb2 .&. m /= 0 = comp (A.index ary1 i) (A.index ary2 j) &&
@@ -2449,7 +2443,11 @@ clone ary =
24492443
--
24502444
-- This constant is named /t/ in the original /Ideal Hash Trees/ paper.
24512445
bitsPerSubkey :: Int
2446+
#if WORD_SIZE_IN_BITS < 64
2447+
bitsPerSubkey = 4
2448+
#else
24522449
bitsPerSubkey = 5
2450+
#endif
24532451

24542452
-- | The size of a 'Full' node, i.e. @2 ^ 'bitsPerSubkey'@.
24552453
maxChildren :: Int

0 commit comments

Comments
 (0)