mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +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) {
|
||||
if (key != null && !key.isEmpty() &&
|
||||
value != null && !value.isEmpty() &&
|
||||
!mimeTypeMap.containsKey(key))
|
||||
{
|
||||
mimeTypeMap.put(key, value);
|
||||
if (!key.isEmpty() && !value.isEmpty()) {
|
||||
mimeTypeMap.putIfAbsent(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue