mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 1370700 part 1 - Use mAttributeCache.LookupRemoveIf() to avoid a second hashtable lookup for Remove(). r=froydnj
MozReview-Commit-ID: CrIb6DcE1D7
This commit is contained in:
parent
e6ddf2c3c1
commit
6cdee8c35e
@ -118,14 +118,11 @@ void
|
||||
nsDOMAttributeMap::DropAttribute(int32_t aNamespaceID, nsIAtom* aLocalName)
|
||||
{
|
||||
nsAttrKey attr(aNamespaceID, aLocalName);
|
||||
Attr *node = mAttributeCache.GetWeak(attr);
|
||||
if (node) {
|
||||
// Break link to map
|
||||
node->SetMap(nullptr);
|
||||
|
||||
// Remove from cache
|
||||
mAttributeCache.Remove(attr);
|
||||
}
|
||||
mAttributeCache.LookupRemoveIf(attr,
|
||||
[] (Attr* aNode) {
|
||||
aNode->SetMap(nullptr); // break link to map
|
||||
return true; // remove from cache
|
||||
});
|
||||
}
|
||||
|
||||
Attr*
|
||||
|
Loading…
x
Reference in New Issue
Block a user