dcapwell commented on code in PR #4013: URL: https://github.com/apache/cassandra/pull/4013#discussion_r2023848174
########## src/java/org/apache/cassandra/utils/FastByteOperations.java: ########## @@ -331,11 +348,17 @@ public static int compareTo(ByteBuffer buffer1, ByteBuffer buffer2) obj1 = buffer1.array(); offset1 = BYTE_ARRAY_BASE_OFFSET + buffer1.arrayOffset(); } + else if (buffer1.isReadOnly() && !buffer1.isDirect()) + { + obj1 = theUnsafe.getObject(buffer1, HEAP_HB_FIELD_OFFSET); + offset1 = BYTE_ARRAY_BASE_OFFSET; Review Comment: is this actually true? what about the following ``` ByteBuffer.wrap(new byte[42]).position(10).asReadOnly() ``` In this case won't the offset be `BYTE_ARRAY_BASE_OFFSET + buffer1.arrayOffset()`? -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org