rpuch commented on code in PR #4689:
URL: https://github.com/apache/ignite-3/pull/4689#discussion_r1833848197


##########
modules/network/src/main/java/org/apache/ignite/internal/network/netty/OutboundEncoder.java:
##########
@@ -98,11 +98,17 @@ private NetworkMessageChunkedInput(
             this.serializationService = serializationService;
             this.msg = outObject.networkMessage();
 
-            List<ClassDescriptorMessage> outDescriptors = 
outObject.descriptors().stream()
-                    .filter(classDescriptorMessage -> 
!serializationService.isDescriptorSent(classDescriptorMessage.descriptorId()))
-                    .collect(Collectors.toList());
+            List<ClassDescriptorMessage> outDescriptors = null;
+            for (ClassDescriptorMessage classDescriptorMessage : 
outObject.descriptors()) {

Review Comment:
   It is certainly not created on the heap, so what happens is allocation of a 
variable on the stack. The same thing that is done in an indexed for loop, but 
more readable and more difficult to break.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to