On Jun 2, 2015, at 3:50 PM, Stefan Zobel <[email protected]> wrote:
> Hi Paul,
>
> Looks good.
>
> I was wondering why the truncate method in Node.OfInt / OfLong / OfDouble
> did not receive the same
>
>
> + if (to == count()) {
> + spliterator.forEachRemaining(nodeBuilder);
> + } else {
> + for (int i = 0; i < size &&
> spliterator.tryAdvance(nodeBuilder); i++) { }
> + }
>
>
> treatment as the truncate method in Node itself. Looks pretty symmetric to
> my untrained eyes?
>
Indeed so, thanks for noticing. Webrev updated in place.
http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8071597-take-drop-while/webrev/src/java.base/share/classes/java/util/stream/Node.java.sdiff.html
Paul.