8287053: Avoid redundant HashMap.containsKey calls in ZoneInfoFile.getZoneInfo0

Reviewed-by: redestad, naoto, rriggs
This commit is contained in:
Andrey Turbanov 2022-05-23 08:29:29 +00:00
parent 414265bd83
commit 01916e1920

View File

@ -125,10 +125,7 @@ public final class ZoneInfoFile {
if (zi != null) {
return zi;
}
String zid = zoneId;
if (aliases.containsKey(zoneId)) {
zid = aliases.get(zoneId);
}
String zid = aliases.getOrDefault(zoneId, zoneId);
int index = Arrays.binarySearch(regions, zid);
if (index < 0) {
return null;
@ -342,7 +339,7 @@ public final class ZoneInfoFile {
}
}
// remove the following ids from the map, they
// are exclued from the "old" ZoneInfo
// are excluded from the "old" ZoneInfo
zones.remove("ROC");
for (int i = 0; i < versionCount; i++) {
int aliasCount = dis.readShort();