SammyVimes commented on code in PR #2256:
URL: https://github.com/apache/ignite-3/pull/2256#discussion_r1247497159
##########
modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleBuilder.java:
##########
@@ -754,8 +669,26 @@ private void putBytes(byte[] bytes) {
buffer.put(bytes);
}
+ private void putBytesWithEmptyCheck(byte[] bytes) {
+ if (bytes.length == 0 || bytes[0] ==
BinaryTupleCommon.VARLEN_EMPTY_BYTE) {
+ ensure(bytes.length + 1);
Review Comment:
why not just ensure(1) and put VARLEN_EMPTY_BYTE?
##########
modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleParser.java:
##########
@@ -551,7 +512,16 @@ private int getOffset(int index) {
}
/**
- * Decode a non-trivial Date element.
+ * Gets array of bytes from a given range in the buffer.
+ */
+ private byte[] getBytes(int begin, int end) {
+ byte[] bytes = new byte[end - begin];
+ buffer.duplicate().position(begin).limit(end).get(bytes);
Review Comment:
```suggestion
buffer.get(begin, bytes);
```
should be ok doing something like that
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]