mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-19 04:13:07 +00:00
8286366: (cs) Charset.put can use putIfAbsent instead of containsKey+put
Reviewed-by: alanb
This commit is contained in:
parent
9becf7d578
commit
6b9c15211e
@ -576,8 +576,7 @@ public abstract class Charset
|
||||
private static void put(Iterator<Charset> i, Map<String,Charset> m) {
|
||||
while (i.hasNext()) {
|
||||
Charset cs = i.next();
|
||||
if (!m.containsKey(cs.name()))
|
||||
m.put(cs.name(), cs);
|
||||
m.putIfAbsent(cs.name(), cs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user