On Sat, 30 Apr 2022 09:45:07 GMT, Andrey Turbanov <[email protected]> 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. This pull request has now been integrated. Changeset: f783244c Author: Andrey Turbanov <[email protected]> URL: https://git.openjdk.org/jdk/commit/f783244caf041b6f79036dfcf29ff857d9c1c78f Stats: 13 lines in 1 file changed: 0 ins; 9 del; 4 mod 8289706: (cs) Avoid redundant TreeMap.containsKey call in AbstractCharsetProvider Reviewed-by: attila, naoto ------------- PR: https://git.openjdk.org/jdk/pull/8483
