You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "SammyVimes (via GitHub)" <gi...@apache.org> on 2023/06/30 10:33:29 UTC

[GitHub] [ignite-3] SammyVimes commented on a diff in pull request #2256: IGNITE-19666 Remove nullmaps from binary tuples

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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org