mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1600963 - don't lookup keys twice in the serialized JSON; r=mccr8
Depends on D55687 Differential Revision: https://phabricator.services.mozilla.com/D55688 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
feb4f82205
commit
03bf239fb9
@ -169,9 +169,12 @@ static nsTArray<typename T::KeyVal> GetJSONKeys(const Json::Value* aInput) {
|
||||
field.valueWasSerialized = false;
|
||||
field.key = static_cast<typename T::SerializableKeys>(i);
|
||||
const std::string key = std::to_string(field.key);
|
||||
if (aInput->isMember(key) && (*aInput)[key].isString()) {
|
||||
field.value.Append(nsDependentCString((*aInput)[key].asCString()));
|
||||
field.valueWasSerialized = true;
|
||||
if (aInput->isMember(key)) {
|
||||
const Json::Value& val = (*aInput)[key];
|
||||
if (val.isString()) {
|
||||
field.value.Append(nsDependentCString(val.asCString()));
|
||||
field.valueWasSerialized = true;
|
||||
}
|
||||
}
|
||||
fields.AppendElement(field);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user