ICU-22425 Eliminate double map lookup for common case of present argument

In the uncommon case where the map lookup returns null, only then perform a second map lookup to determine whether it was an absent value or explicit null.
This commit is contained in:
Jake Wharton 2023-06-26 13:59:28 -04:00 committed by Yoshito Umaoka
parent 1b15a4e9db
commit cd6ff4a64d

View file

@ -1683,8 +1683,11 @@ public class MessageFormat extends UFormat {
}
} else {
argId = argName;
if(argsMap!=null && argsMap.containsKey(argName)) {
if(argsMap!=null) {
arg=argsMap.get(argName);
if (arg==null) {
noArg=!argsMap.containsKey(argName);
}
} else {
arg=null;
noArg=true;