зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1729329 - Mark txUnionNodeTest::addNodeTest as infallible. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D124665
This commit is contained in:
Родитель
089504dc85
Коммит
750cd9da88
|
@ -817,9 +817,8 @@ class txNamedAttributeStep : public Expr {
|
|||
*/
|
||||
class txUnionNodeTest : public txNodeTest {
|
||||
public:
|
||||
nsresult addNodeTest(txNodeTest* aNodeTest) {
|
||||
void addNodeTest(txNodeTest* aNodeTest) {
|
||||
mNodeTests.AppendElement(aNodeTest);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
TX_DECL_NODE_TEST
|
||||
|
|
|
@ -191,7 +191,6 @@ nsresult txXPathOptimizer::optimizeUnion(Expr* aInExpr, Expr** aOutExpr) {
|
|||
// Check for expressions like "foo | bar" and
|
||||
// "descendant::foo | descendant::bar"
|
||||
|
||||
nsresult rv;
|
||||
uint32_t current;
|
||||
Expr* subExpr;
|
||||
for (current = 0; (subExpr = uni->getSubExprAt(current)); ++current) {
|
||||
|
@ -222,16 +221,14 @@ nsresult txXPathOptimizer::optimizeUnion(Expr* aInExpr, Expr** aOutExpr) {
|
|||
// Create a txUnionNodeTest if needed
|
||||
if (!unionTest) {
|
||||
UniquePtr<txNodeTest> owner(unionTest = new txUnionNodeTest);
|
||||
rv = unionTest->addNodeTest(currentStep->getNodeTest());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
unionTest->addNodeTest(currentStep->getNodeTest());
|
||||
|
||||
currentStep->setNodeTest(unionTest);
|
||||
Unused << owner.release();
|
||||
}
|
||||
|
||||
// Merge the nodetest into the union
|
||||
rv = unionTest->addNodeTest(step->getNodeTest());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
unionTest->addNodeTest(step->getNodeTest());
|
||||
|
||||
step->setNodeTest(nullptr);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче