jdk/src/share/classes/java/util/stream/DoublePipeline.java
changeset 19800 6e1fef53ea55
parent 19593 ce0cd954351c
child 19850 93b368e54c1c
equal deleted inserted replaced
19799:efa9ff09b024 19800:6e1fef53ea55
   264                         downstream.begin(-1);
   264                         downstream.begin(-1);
   265                     }
   265                     }
   266 
   266 
   267                     @Override
   267                     @Override
   268                     public void accept(double t) {
   268                     public void accept(double t) {
   269                         // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
   269                         try (DoubleStream result = mapper.apply(t)) {
   270                         DoubleStream result = mapper.apply(t);
   270                             // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
   271                         if (result != null)
   271                             if (result != null)
   272                             result.sequential().forEach(i -> downstream.accept(i));
   272                                 result.sequential().forEach(i -> downstream.accept(i));
       
   273                         }
   273                     }
   274                     }
   274                 };
   275                 };
   275             }
   276             }
   276         };
   277         };
   277     }
   278     }