Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika

Differential Revision: https://phabricator.services.mozilla.com/D104676
This commit is contained in:
Simon Giesecke
2021-02-22 12:07:46 +00:00
parent af151ef6a4
commit 9d60f9c227
37 changed files with 261 additions and 322 deletions

View File

@@ -2170,10 +2170,8 @@ HTMLFormElement::WalkRadioGroup(const nsAString& aName,
void HTMLFormElement::AddToRadioGroup(const nsAString& aName,
HTMLInputElement* aRadio) {
if (aRadio->IsRequired()) {
mRequiredRadioButtonCounts.WithEntryHandle(aName, [](auto&& entry) {
uint32_t& value = entry.OrInsert(0);
++value;
});
uint32_t& value = mRequiredRadioButtonCounts.GetOrInsert(aName, 0);
++value;
}
}