directly return after folding the special case of list comprehension

This commit is contained in:
CrescentonC 2021-07-19 13:52:53 +08:00
parent 7b93720236
commit 8f0c335422
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ impl<'a> ast::fold::Fold<()> for InferenceContext<'a> {
// assert_eq!(node.custom, None);
let expr = match &node.node {
ast::ExprKind::ListComp { .. } => self.fold_listcomp(node)?,
ast::ExprKind::ListComp { .. } => return self.fold_listcomp(node),
_ => rustpython_parser::ast::fold::fold_expr(self, node)?
};