Skip to content

Commit 72eb8ba

Browse files
somdoronCopilot
andauthored
Update raft/src/test/scala/zio/raft/HMapRangeByCompoundKeyPrefixSpec.scala
Co-authored-by: Copilot <[email protected]>
1 parent 5a7aca5 commit 72eb8ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

raft/src/test/scala/zio/raft/HMapRangeByCompoundKeyPrefixSpec.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import java.nio.charset.StandardCharsets
77
object HMapRangeByCompoundKeyPrefixSpec extends ZIOSpecDefault:
88

99
// Compound key encoding:
10-
// bytes = firstComponentUtf8 ++ 0x00 ++ secondComponentUtf8
10+
// bytes = lengthOfFirstComponent (1 byte) ++ firstComponentUtf8 ++ [lengthOfSecondComponent (1 byte) ++ secondComponentUtf8]
11+
// (The second component is omitted if empty.)
1112
// This ensures that all keys that share the same first component are in a contiguous
12-
// lexicographic range [first ++ 0x00, first ++ 0x01), which is what
13+
// lexicographic range [firstComponentLength ++ firstComponentUtf8, ...), which is what
1314
// rangeByCompoundKeyPrefix relies on by computing the upper bound via +1 on the last byte.
1415
given HMap.KeyLike[(String, String)] with
1516
def asBytes(key: (String, String)): Array[Byte] =

0 commit comments

Comments
 (0)