Skip to content

Commit

Permalink
Bug 1349695 - Part 3: Convert manual addrefs in txNodeSorter::sortNod…
Browse files Browse the repository at this point in the history
…eSet. r=peterv

Use RefPtr::forget to avoid an AddRef/Release pair when returning.
  • Loading branch information
EricRahm committed Apr 10, 2017
1 parent 7a68f28 commit 3ab41f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dom/xslt/xslt/txNodeSorter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -194,7 +195,7 @@ txNodeSorter::sortNodeSet(txNodeSet* aNodes, txExecutionState* aEs,

delete aEs->popEvalContext();

NS_ADDREF(*aResult = sortedNodes);
sortedNodes.forget(aResult);

return NS_OK;
}
Expand Down

0 comments on commit 3ab41f1

Please sign in to comment.