zstan commented on a change in pull request #8380:
URL: https://github.com/apache/ignite/pull/8380#discussion_r510790611



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/Inbox.java
##########
@@ -216,7 +216,7 @@ private void push() throws IgniteCheckedException {
     /** */
     private void pushOrdered() throws IgniteCheckedException {
          PriorityQueue<Pair<Row, Buffer>> heap =
-            new PriorityQueue<>(buffers.size(), 
Map.Entry.comparingByKey(comp));
+            new PriorityQueue<>(Math.max(buffers.size(), 1), 
Map.Entry.comparingByKey(comp));

Review comment:
       i understand why you refactor here: Math.max, but why do we need 
additional allocation here ? 
   if (buffers.isEmpty)
     PriorityQueue<Pair<Row, Buffer>> heap = null; and further F.isEmpty(heap) 
check would be match clear, isn`t it ?




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