mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1181445 (part 4) - Use nsTHashTable::Iterator in nsCategoryManager. r=froydnj.
This commit is contained in:
parent
8a6e87eb69
commit
afe7b7aefd
@ -167,24 +167,9 @@ class EntryEnumerator
|
||||
{
|
||||
public:
|
||||
static EntryEnumerator* Create(nsTHashtable<CategoryLeaf>& aTable);
|
||||
|
||||
private:
|
||||
static PLDHashOperator enumfunc_createenumerator(CategoryLeaf* aLeaf,
|
||||
void* aUserArg);
|
||||
};
|
||||
|
||||
|
||||
PLDHashOperator
|
||||
EntryEnumerator::enumfunc_createenumerator(CategoryLeaf* aLeaf, void* aUserArg)
|
||||
{
|
||||
EntryEnumerator* mythis = static_cast<EntryEnumerator*>(aUserArg);
|
||||
if (aLeaf->value) {
|
||||
mythis->mArray[mythis->mCount++] = aLeaf->GetKey();
|
||||
}
|
||||
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
EntryEnumerator*
|
||||
EntryEnumerator::Create(nsTHashtable<CategoryLeaf>& aTable)
|
||||
{
|
||||
@ -199,7 +184,12 @@ EntryEnumerator::Create(nsTHashtable<CategoryLeaf>& aTable)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
aTable.EnumerateEntries(enumfunc_createenumerator, enumObj);
|
||||
for (auto iter = aTable.Iter(); !iter.Done(); iter.Next()) {
|
||||
CategoryLeaf* leaf = iter.Get();
|
||||
if (leaf->value) {
|
||||
enumObj->mArray[enumObj->mCount++] = leaf->GetKey();
|
||||
}
|
||||
}
|
||||
|
||||
enumObj->Sort();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user