Adjust to reduce duplication

This commit is contained in:
Michael Hansen
2022-10-04 15:15:02 -07:00
parent e2db195b85
commit 747921a761

View File

@@ -1784,13 +1784,15 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> 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<ASTCall>()->pparams().empty() ) {
PycRef<ASTNode> res = value.cast<ASTCall>()->pparams().front();
if (value.type() == ASTNode::NODE_CALL) {
auto& pparams = value.cast<ASTCall>()->pparams();
if (!pparams.empty()) {
PycRef<ASTNode> res = pparams.front();
stack.push(new ASTComprehension(res));
}
}
}
}
break;
case Pyc::PRINT_ITEM:
{