-
Enhancement
-
Resolution: Fixed
-
P5
-
None
The method sun.nio.cs.ext.AbstractCharsetProvider#put is effectively equivalent of Map.putIfAbsent call.
private static <K,V> void put(Map<K,V> m, K name, V value) {
if (!m.containsKey(name))
m.put(name, value);
}
Instead of hand-written method we can use 'putIfAbsent' directly.
I makes code cleaner and gives a bit of performance.
private static <K,V> void put(Map<K,V> m, K name, V value) {
if (!m.containsKey(name))
m.put(name, value);
}
Instead of hand-written method we can use 'putIfAbsent' directly.
I makes code cleaner and gives a bit of performance.