Skip to content

Commit 8cc76bb

Browse files
committed
Make sure keys are unsliced in compact index search
If they're not unsliced, then tests will fail.
1 parent ed9f351 commit 8cc76bb

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/Database/LSMTree/Internal/Index/Compact.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ search k IndexCompact{..} =
418418
bitIndexFromToRev (BoundInclusive 0) (BoundInclusive i) (Bit False) icClashes
419419
-- The TB map is consulted to find the closest key smaller than k.
420420
!i2 = maybe (PageNo 0) snd $
421-
Map.lookupLE (unsafeNoAssertMakeUnslicedKey k) icTieBreaker
421+
Map.lookupLE (makeUnslicedKey k) icTieBreaker
422422
-- If i2 < i1, then it means the clashing pages were all just part
423423
-- of the same larger-than-page value. Entries are only included
424424
-- in the TB map if the clash was a *proper* clash.

src/Database/LSMTree/Internal/Unsliced.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Database.LSMTree.Internal.Unsliced (
1111
, makeUnslicedKey
1212
, unsafeMakeUnslicedKey
1313
, fromUnslicedKey
14-
, unsafeNoAssertMakeUnslicedKey
1514
) where
1615

1716
import Control.DeepSeq (NFData)
@@ -43,9 +42,6 @@ makeUnsliced bytes
4342
unsafeMakeUnsliced :: RawBytes -> Unsliced RawBytes
4443
unsafeMakeUnsliced bytes = assert (precondition bytes) (Unsliced (getByteArray bytes))
4544

46-
unsafeNoAssertMakeUnsliced :: RawBytes -> Unsliced RawBytes
47-
unsafeNoAssertMakeUnsliced bytes = Unsliced (getByteArray bytes)
48-
4945
fromUnsliced :: Unsliced RawBytes -> RawBytes
5046
fromUnsliced (Unsliced ba) = RawBytes (mkPrimVector 0 (sizeofByteArray ba) ba)
5147

@@ -65,9 +61,6 @@ makeUnslicedKey (SerialisedKey rb) = from (makeUnsliced rb)
6561
unsafeMakeUnslicedKey :: SerialisedKey -> Unsliced SerialisedKey
6662
unsafeMakeUnslicedKey (SerialisedKey rb) = from (unsafeMakeUnsliced rb)
6763

68-
unsafeNoAssertMakeUnslicedKey :: SerialisedKey -> Unsliced SerialisedKey
69-
unsafeNoAssertMakeUnslicedKey (SerialisedKey rb) = from (unsafeNoAssertMakeUnsliced rb)
70-
7164
fromUnslicedKey :: Unsliced SerialisedKey -> SerialisedKey
7265
fromUnslicedKey x = SerialisedKey (fromUnsliced (to x))
7366

0 commit comments

Comments
 (0)