<i18n dev> RFR: 8289706: (cs) Avoid redundant TreeMap.containsKey call in AbstractCharsetProvider

Naoto Sato naoto at openjdk.org
Tue Jul 5 16:39:32 UTC 2022


On Sat, 30 Apr 2022 09:45:07 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> The method `sun.nio.cs.ext.AbstractCharsetProvider#put` is effectively equivalent of `Map.putIfAbsent` call.
> 
> https://github.com/openjdk/jdk/blob/df063f7db18a40ea7325fe608b3206a6dff812c1/src/jdk.charsets/share/classes/sun/nio/cs/ext/AbstractCharsetProvider.java#L81-L84
> 
> Instead of hand-written method we can use `putIfAbsent` directly.
> I makes code cleaner and gives a bit of performance.

Marked as reviewed by naoto (Reviewer).

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

PR: https://git.openjdk.org/jdk/pull/8483


More information about the i18n-dev mailing list