mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Bug 1349695 - Part 3: Convert manual addrefs in txNodeSorter::sortNodeSet. r=peterv
Use RefPtr::forget to avoid an AddRef/Release pair when returning.
This commit is contained in:
parent
7a68f28ccb
commit
3ab41f111b
@ -127,7 +127,8 @@ txNodeSorter::sortNodeSet(txNodeSet* aNodes, txExecutionState* aEs,
|
||||
txNodeSet** aResult)
|
||||
{
|
||||
if (mNKeys == 0 || aNodes->isEmpty()) {
|
||||
NS_ADDREF(*aResult = aNodes);
|
||||
RefPtr<txNodeSet> ref(aNodes);
|
||||
ref.forget(aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -194,7 +195,7 @@ txNodeSorter::sortNodeSet(txNodeSet* aNodes, txExecutionState* aEs,
|
||||
|
||||
delete aEs->popEvalContext();
|
||||
|
||||
NS_ADDREF(*aResult = sortedNodes);
|
||||
sortedNodes.forget(aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user