Integrated: 8277535: Remove redundant Stream.distinct()/sorted() steps

Andrey Turbanov aturbanov at openjdk.java.net
Thu Jan 20 18:15:55 UTC 2022


On Mon, 27 Sep 2021 11:20:53 GMT, Andrey Turbanov <aturbanov at openjdk.org> 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)

This pull request has now been integrated.

Changeset: 3419ff7b
Author:    Andrey Turbanov <aturbanov at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/3419ff7ba70b778906249dd5ab3a91998ca5a864
Stats:     6 lines in 3 files changed: 0 ins; 4 del; 2 mod

8277535: Remove redundant Stream.distinct()/sorted() steps

Reviewed-by: prappo

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

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


More information about the core-libs-dev mailing list