mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187151 (part 1) - Replace nsBaseHashtable::Enumerate() calls in dom/base/ with iterators. r=khuey.
This commit is contained in:
parent
b22e3aa1c4
commit
1c1c3bd028
@ -124,22 +124,13 @@ NS_INTERFACE_MAP_END
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMAttributeMap)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMAttributeMap)
|
||||
|
||||
PLDHashOperator
|
||||
SetOwnerDocumentFunc(nsAttrHashKey::KeyType aKey,
|
||||
RefPtr<Attr>& aData,
|
||||
void* aUserArg)
|
||||
{
|
||||
nsresult rv = aData->SetOwnerDocument(static_cast<nsIDocument*>(aUserArg));
|
||||
|
||||
return NS_FAILED(rv) ? PL_DHASH_STOP : PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMAttributeMap::SetOwnerDocument(nsIDocument* aDocument)
|
||||
{
|
||||
uint32_t n = mAttributeCache.Enumerate(SetOwnerDocumentFunc, aDocument);
|
||||
NS_ENSURE_TRUE(n == mAttributeCache.Count(), NS_ERROR_FAILURE);
|
||||
|
||||
for (auto iter = mAttributeCache.Iter(); !iter.Done(); iter.Next()) {
|
||||
nsresult rv = iter.Data()->SetOwnerDocument(aDocument);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user