Navigation Menu

Skip to content

Commit

Permalink
8287602: (fs) Avoid redundant HashMap.containsKey call in MimeTypesFi…
Browse files Browse the repository at this point in the history
…leTypeDetector.putIfAbsent

Reviewed-by: bpb, jpai, alanb
  • Loading branch information
Andrey Turbanov committed Jun 1, 2022
1 parent 239ac2a commit 27ad1d5
Showing 1 changed file with 2 additions and 5 deletions.
Expand Up @@ -187,11 +187,8 @@ private void parseMimeEntry(String entry) {
}

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);
}
}
}

0 comments on commit 27ad1d5

Please sign in to comment.