-
Enhancement
-
Resolution: Fixed
-
P5
-
None
-
b26
Only non-null values are put into Map<String,String> mimeTypeMap. It means, we can replace containsKey+put calls with single putIfAbsent call. It makes code a bit cleaner and faster.
private void putIfAbsent(String key, String value) {
if (key != null && !key.isEmpty() &&
value != null && !value.isEmpty() &&
!mimeTypeMap.containsKey(key))
{
mimeTypeMap.put(key, value);
}
}
private void putIfAbsent(String key, String value) {
if (key != null && !key.isEmpty() &&
value != null && !value.isEmpty() &&
!mimeTypeMap.containsKey(key))
{
mimeTypeMap.put(key, value);
}
}