On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang <d...@openjdk.org> wrote:
> Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. src/java.base/share/classes/java/util/stream/Collectors.java line 1988: > 1986: public T get(Object key) { > 1987: if (key instanceof Boolean b) { > 1988: return b.booleanValue() ? forTrue : forFalse; Usages of partitioningBy are likely to be followed by get(TRUE) and get(FALSE) to get the sets in each partition, so this looks good, avoids needing the entrySet and and iterator. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13347#discussion_r1158336071