symious commented on code in PR #1062:
URL: https://github.com/apache/ratis/pull/1062#discussion_r1560661616


##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/LogProtoUtils.java:
##########
@@ -137,8 +137,9 @@ public static LogEntryProto 
removeStateMachineData(LogEntryProto entry) {
   }
 
   private static LogEntryProto 
replaceStateMachineDataWithSerializedSize(LogEntryProto entry) {
-    return replaceStateMachineEntry(entry,
+    LogEntryProto replaced = replaceStateMachineEntry(entry,
         
StateMachineEntryProto.newBuilder().setLogEntryProtoSerializedSize(entry.getSerializedSize()));
+    return copy(replaced);

Review Comment:
   @duongkame I thought `replaced` is already a newly build object on heap and 
not dependent on `entry` anymore, so copy might be redundant here?



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

Reply via email to