scampi commented on a change in pull request #6402: URL: https://github.com/apache/arrow/pull/6402#discussion_r446429063
########## File path: java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java ########## @@ -751,55 +757,57 @@ private void splitAndTransferOffsetBuffer(int startIndex, int length, BaseVariab */ private void splitAndTransferValidityBuffer(int startIndex, int length, BaseVariableWidthVector target) { - int firstByteSource = BitVectorHelper.byteIndex(startIndex); - int lastByteSource = BitVectorHelper.byteIndex(valueCount - 1); - int byteSizeTarget = getValidityBufferSizeFromCount(length); - int offset = startIndex % 8; + if (length <= 0) { Review comment: > It seems like you're leaving this function with a different number of references than the other exit points. I'm not sure I understand. Before, the body of the function was contained in a big if: I thought it was good to return early for clarity and avoid declaring variables like `firstByteSource` or `lastByteSource` for nothing. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org