Adjust to reduce duplication
This commit is contained in:
10
ASTree.cpp
10
ASTree.cpp
@@ -1784,10 +1784,12 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
|||||||
* If it's a comprehension, the only POP_TOP should be
|
* If it's a comprehension, the only POP_TOP should be
|
||||||
* a call to append the iter to the list.
|
* a call to append the iter to the list.
|
||||||
*/
|
*/
|
||||||
if (value.type() == ASTNode::NODE_CALL && !value.cast<ASTCall>()->pparams().empty() ) {
|
if (value.type() == ASTNode::NODE_CALL) {
|
||||||
PycRef<ASTNode> res = value.cast<ASTCall>()->pparams().front();
|
auto& pparams = value.cast<ASTCall>()->pparams();
|
||||||
|
if (!pparams.empty()) {
|
||||||
stack.push(new ASTComprehension(res));
|
PycRef<ASTNode> res = pparams.front();
|
||||||
|
stack.push(new ASTComprehension(res));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user