On Mon, 27 Sep 2021 11:20:53 GMT, Andrey Turbanov <d...@openjdk.java.net> wrote:

> 1. Stream.distinct() is redundant before toSet() collector. Duplicates will 
> be collapsed by Collector.
> 2. Stream.sorted() is redundant before toMap() collector. Keys will be 
> shuffled by Collector (it's a HashMap in current implementation)

Looks good. Please update the copyright years before integrating.

Note that in general, removing distinct() immediately before Collectors.toSet() 
might change the behavior. If operated on an ordered stream, distinct() is 
guaranteed to yield a stable order.

-------------

Marked as reviewed by prappo (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5714

Reply via email to