Jackie-Jiang commented on code in PR #13215:
URL: https://github.com/apache/pinot/pull/13215#discussion_r1617717630


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java:
##########
@@ -218,10 +223,10 @@ public int add(byte[] value) {
     int index = buffer.add(value);
     if (index < 0) {
       // Need to expand the buffer
-      int currentBufferSize = buffer.getSize();
-      if ((currentBufferSize << 1) >= 0) {
+      long nextBufferSize = buffer.getSize() << 1;

Review Comment:
   Do you need to cast before shifting?



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java:
##########
@@ -218,10 +223,10 @@ public int add(byte[] value) {
     int index = buffer.add(value);
     if (index < 0) {
       // Need to expand the buffer
-      int currentBufferSize = buffer.getSize();
-      if ((currentBufferSize << 1) >= 0) {
+      long nextBufferSize = buffer.getSize() << 1;

Review Comment:
   Just realize we don't need to change this. Checking if it `>= 0` after 
shifting is always correct



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to