mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1186806 - Part 1: Replace nsBaseHashtable::EnumerateRead() with iterators in HTMLFormControlsCollection. r=khuey
This commit is contained in:
parent
67cb3856af
commit
a55459b97f
@ -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*
|
||||
|
Loading…
Reference in New Issue
Block a user