Re: RFR 8148115: Stream.findFirst for unordered source optimization

2016-01-29 Thread Paul Sandoz
> On 29 Jan 2016, at 15:20, Tagir F. Valeev wrote: > > Here's updated webrev: > > http://cr.openjdk.java.net/~tvaleev/webrev/8148115/r2/ > Thanks, reviewed and in my queue. > PS> 293 if (!this.mustFindFirst) { > PS> 310 if (this.mustFindFirst) { > PS> Small thing,

Re: RFR 8148115: Stream.findFirst for unordered source optimization

2016-01-29 Thread Tagir F. Valeev
Here's updated webrev: http://cr.openjdk.java.net/~tvaleev/webrev/8148115/r2/ PS> 293 if (!this.mustFindFirst) { PS> 310 if (this.mustFindFirst) { PS> Small thing, no need for “this”. Done. PS> You can now use Optional.ifPresentOrElse, which was added in 9: PS> ifP

Re: RFR 8148115: Stream.findFirst for unordered source optimization

2016-01-26 Thread Paul Sandoz
Hi Tagir, Looks good. Just small things. FindOps.java — 293 if (!this.mustFindFirst) { 310 if (this.mustFindFirst) { Small thing, no need for “this”. LambdaTestHelpers — 404 public static void assertContains(Optional actual, Iterator it) { 405 if (

RFR 8148115: Stream.findFirst for unordered source optimization

2016-01-23 Thread Tagir F. Valeev
Hello, Paul! Thank you for review. I implemented it according to your suggestions, here's issue: https://bugs.openjdk.java.net/browse/JDK-8148115 And webrev: http://cr.openjdk.java.net/~tvaleev/webrev/8148115/r1/ This patch required some changes in existing tests as FindFirstOpTest asserted that

Re: Stream.findFirst for unordered source optimization

2016-01-22 Thread Paul Sandoz
Hi Tagir, Thanks for looking at this. I would prefer if a boolean was passed into the task constructor e.g.: @Override public O evaluateParallel(PipelineHelper helper, Spliterator spliterator) { // This takes into account the upstream ops flags and the termi

Stream.findFirst for unordered source optimization

2016-01-21 Thread Tagir F. Valeev
Hello! Seems that currently Stream.findFirst is not optimized for unordered source. I think it should work as findAny in this case. Here's a small patch which fixes this: http://cr.openjdk.java.net/~tvaleev/patches/findFirst/find_patch.txt Simple JMH test: http://cr.openjdk.java.net/~tvaleev/pat