]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unnecessary basic block from comprehensions (GH-31263)
authorBrandt Bucher <brandtbucher@microsoft.com>
Mon, 14 Feb 2022 17:48:45 +0000 (09:48 -0800)
committerGitHub <noreply@github.com>
Mon, 14 Feb 2022 17:48:45 +0000 (17:48 +0000)
Python/compile.c

index bfe451b8c104796e3c9846f527ba40d3328c60f9..ac4960b5df320ebf7872f16622417cd248cbec90 100644 (file)
@@ -5034,17 +5034,16 @@ compiler_sync_comprehension_generator(struct compiler *c,
        and then write to the element */
 
     comprehension_ty gen;
-    basicblock *start, *anchor, *skip, *if_cleanup;
+    basicblock *start, *anchor, *if_cleanup;
     Py_ssize_t i, n;
 
     start = compiler_new_block(c);
-    skip = compiler_new_block(c);
     if_cleanup = compiler_new_block(c);
     anchor = compiler_new_block(c);
 
-    if (start == NULL || skip == NULL || if_cleanup == NULL ||
-        anchor == NULL)
+    if (start == NULL || if_cleanup == NULL || anchor == NULL) {
         return 0;
+    }
 
     gen = (comprehension_ty)asdl_seq_GET(generators, gen_index);
 
@@ -5131,8 +5130,6 @@ compiler_sync_comprehension_generator(struct compiler *c,
         default:
             return 0;
         }
-
-        compiler_use_next_block(c, skip);
     }
     compiler_use_next_block(c, if_cleanup);
     if (start) {