merlimat commented on a change in pull request #1141: Replace DoubleByteBuf 
with ByteBufList
URL: https://github.com/apache/bookkeeper/pull/1141#discussion_r167667553
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
 ##########
 @@ -560,8 +562,7 @@ void addEntry(final long ledgerId, byte[] masterKey, final 
long entryId, ByteBuf
                     .setOperation(OperationType.ADD_ENTRY)
                     .setTxnId(txnId);
 
-            byte[] toSendArray = new byte[toSend.readableBytes()];
-            toSend.getBytes(toSend.readerIndex(), toSendArray);
+            byte[] toSendArray = toSend.toArray();
 
 Review comment:
   I agree with the above comments, though I'd rather leave this outside the 
scope of this PR which is a 1-1 replacement for `DoubleByteBuf`. The `byte[]` 
copies are not changing with this change.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to