Combine StreamSupport.stream/parallelStream?
Remi Forax
forax at univ-mlv.fr
Fri Jun 28 03:20:46 PDT 2013
On 06/27/2013 10:43 PM, Brian Goetz wrote:
> A possible minor API cleanup:
>
> For each pair of low-level methods stream() and parallelStream() in
> StreamSupport, we could combine these into a single method that takes
> an additional boolean isParallel argument. This matches the
> underlying implementation they call anyway, and simplifies callers
> like concat, which now does:
>
> return (a.isParallel() || b.isParallel())
> ? StreamSupport.parallelStream(split)
> : StreamSupport.stream(split);
>
> anyway.
What if we add a third kind of stream in the future ?
Rémi
More information about the lambda-libs-spec-observers
mailing list