Skip to content

Commit a8e8334

Browse files
vbabaninstIncMale
andauthored
Update bson/src/main/org/bson/io/ByteBufferBsonInput.java
Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
1 parent 8bf0ab1 commit a8e8334

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bson/src/main/org/bson/io/ByteBufferBsonInput.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ private int computeCStringLength(final int prevPos) {
215215
mask:
216216
00000000 00000000 11111111 00000000 00000001 00000001 00000000 00000111
217217
218-
ANDing mask with 0x8080808080808080 isolates the most significant bit (0x80) in positions where
219-
the original byte was 0x00, thereby setting the most significant bit to 1 only at the 0x00 byte position.
218+
ANDing mask with 0x8080808080808080 isolates the most significant bit in each byte where
219+
the original byte was 0x00, thereby setting the most significant bit to 1 in each 0x00 original byte.
220220
221221
result:
222222
00000000 00000000 10000000 00000000 00000000 00000000 00000000 00000000

0 commit comments

Comments
 (0)