Bug 1186806 - Part 1: Replace nsBaseHashtable::EnumerateRead() with iterators in HTMLFormControlsCollection. r=khuey

This commit is contained in:
Birunthan Mohanathas 2015-07-27 18:45:12 -07:00
parent 67cb3856af
commit a55459b97f

View File

@ -389,15 +389,6 @@ HTMLFormControlsCollection::NamedGetter(const nsAString& aName,
MOZ_ASSERT_UNREACHABLE("Should only have Elements and NodeLists here.");
}
static PLDHashOperator
CollectNames(const nsAString& aName,
nsISupports* /* unused */,
void* aClosure)
{
static_cast<nsTArray<nsString>*>(aClosure)->AppendElement(aName);
return PL_DHASH_NEXT;
}
void
HTMLFormControlsCollection::GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames)
@ -410,7 +401,9 @@ HTMLFormControlsCollection::GetSupportedNames(unsigned aFlags,
// Just enumerate mNameLookupTable. This won't guarantee order, but
// that's OK, because the HTML5 spec doesn't define an order for
// this enumeration.
mNameLookupTable.EnumerateRead(CollectNames, &aNames);
for (auto iter = mNameLookupTable.Iter(); !iter.Done(); iter.Next()) {
aNames.AppendElement(iter.Key());
}
}
/* virtual */ JSObject*