From 747921a76106ac0c47556dfafa1646975ffd8aae Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Tue, 4 Oct 2022 15:15:02 -0700 Subject: [PATCH] Adjust to reduce duplication --- ASTree.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ASTree.cpp b/ASTree.cpp index a97aa6d..0fb8497 100644 --- a/ASTree.cpp +++ b/ASTree.cpp @@ -1784,10 +1784,12 @@ PycRef BuildFromCode(PycRef code, PycModule* mod) * If it's a comprehension, the only POP_TOP should be * a call to append the iter to the list. */ - if (value.type() == ASTNode::NODE_CALL && !value.cast()->pparams().empty() ) { - PycRef res = value.cast()->pparams().front(); - - stack.push(new ASTComprehension(res)); + if (value.type() == ASTNode::NODE_CALL) { + auto& pparams = value.cast()->pparams(); + if (!pparams.empty()) { + PycRef res = pparams.front(); + stack.push(new ASTComprehension(res)); + } } } }