Skip to content

Commit a3c3857

Browse files
authored
Modify a redundant code for CAPIHelper (#1653)
Remove duplication in CAPIHelper
1 parent 3c79d53 commit a3c3857

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/CAPIHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ static BinaryHolder toBinary(final BsonDocument document) {
5151
}
5252

5353
static RawBsonDocument toDocument(final mongocrypt_binary_t binary) {
54-
ByteBuffer byteBuffer = toByteBuffer(binary);
55-
byte[] bytes = new byte[byteBuffer.remaining()];
56-
byteBuffer.get(bytes);
54+
byte[] bytes = toByteArray(binary);
5755
return new RawBsonDocument(bytes);
5856
}
5957

0 commit comments

Comments
 (0)