From c43e707f4379063ca395a4bb85d4eaf7e428d647 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 23 Jun 2023 08:59:09 -0400 Subject: [PATCH] Internals: refactor sameTreeIter. No functional change. --- src/V3Ast.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 5f6c6576b..2f2d57e30 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -1081,10 +1081,9 @@ bool AstNode::sameTreeIter(const AstNode* node1p, const AstNode* node2p, bool ig // private: Return true if the two trees are identical if (!node1p && !node2p) return true; if (!node1p || !node2p) return false; - if (node1p->type() != node2p->type() || node1p->dtypep() != node2p->dtypep() - || !node1p->same(node2p) || (gateOnly && !node1p->isGateOptimizable())) { - return false; - } + if (node1p->type() != node2p->type()) return false; + if (node1p->dtypep() != node2p->dtypep()) return false; + if (!node1p->same(node2p) || (gateOnly && !node1p->isGateOptimizable())) return false; return (sameTreeIter(node1p->m_op1p, node2p->m_op1p, false, gateOnly) && sameTreeIter(node1p->m_op2p, node2p->m_op2p, false, gateOnly) && sameTreeIter(node1p->m_op3p, node2p->m_op3p, false, gateOnly)