alamar commented on a change in pull request #8577:
URL: https://github.com/apache/ignite/pull/8577#discussion_r548872973



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v2/DirectByteBufferStreamImplV2.java
##########
@@ -584,7 +587,17 @@ public DirectByteBufferStreamImplV2(MessageFactory 
msgFactory) {
 
     /** {@inheritDoc} */
     @Override public void writeString(String val) {
-        writeByteArray(val != null ? val.getBytes() : null);
+        if (val != null) {
+            if (byteArr == null)
+                byteArr = val.getBytes();
+
+            writeByteArray(byteArr);
+
+            if (lastFinished)
+                byteArr = null;
+        }
+        else
+            writeByteArray(null);

Review comment:
       Disregard this, we are going to read curStrBackingArr value either way. 
I think we may skip this change entirely, just rename var / mark volatile.




----------------------------------------------------------------
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:
[email protected]


Reply via email to