clintropolis commented on code in PR #12475:
URL: https://github.com/apache/druid/pull/12475#discussion_r856511211


##########
core/src/main/java/org/apache/druid/common/guava/CombiningSequence.java:
##########
@@ -94,52 +110,37 @@ public <OutType> Yielder<OutType> toYielder(OutType 
initValue, final YieldingAcc
 
   private <OutType> Yielder<OutType> makeYielder(
       final Yielder<T> yielder,
-      final CombiningYieldingAccumulator<OutType, T> combiningAccumulator,
-      boolean finalValue
+      final CombiningYieldingAccumulator<OutType, T> combiningAccumulator
   )
   {
-    final Yielder<T> finalYielder;
-    final OutType retVal;
-    final boolean finalFinalValue;
-
-    if (!yielder.isDone()) {
-      retVal = combiningAccumulator.getRetVal();
-      finalYielder = null;
-      finalFinalValue = false;
-    } else {
-      if (!finalValue && combiningAccumulator.accumulatedSomething()) {
-        combiningAccumulator.accumulateLastValue();
-        retVal = combiningAccumulator.getRetVal();
-        finalFinalValue = true;
-
-        if (!combiningAccumulator.yielded()) {
-          return Yielders.done(retVal, yielder);
-        } else {
-          finalYielder = Yielders.done(null, yielder);
-        }
-      } else {
-        return Yielders.done(combiningAccumulator.getRetVal(), yielder);
-      }
-    }
-
-
     return new Yielder<OutType>()
     {
+      private Yielder<T> myYielder = yielder;
+      private CombiningYieldingAccumulator<OutType, T> accum = 
combiningAccumulator;

Review Comment:
   nit: this can be final



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to