mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8287602: (fs) Avoid redundant HashMap.containsKey call in MimeTypesFileTypeDetector.putIfAbsent
Reviewed-by: bpb, jpai, alanb
This commit is contained in:
parent
239ac2a5d4
commit
27ad1d5549
1 changed files with 2 additions and 5 deletions
|
@ -187,11 +187,8 @@ class MimeTypesFileTypeDetector extends AbstractFileTypeDetector {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void putIfAbsent(String key, String value) {
|
private void putIfAbsent(String key, String value) {
|
||||||
if (key != null && !key.isEmpty() &&
|
if (!key.isEmpty() && !value.isEmpty()) {
|
||||||
value != null && !value.isEmpty() &&
|
mimeTypeMap.putIfAbsent(key, value);
|
||||||
!mimeTypeMap.containsKey(key))
|
|
||||||
{
|
|
||||||
mimeTypeMap.put(key, value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue