From 21ee37c94e78e43adabf178c53401cebde4ce96f Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Thu, 25 Jul 2002 06:18:42 +0000 Subject: remove spurious SET_LINENO from com_list_for and com_list_if. All they do is slow things down unnecessarily and make tracing much more verbose. Something like def f(n): return [i for i in range(n) if i%2] should have at most two SET_LINENO instructions, not four. When tracing, the current line number should be printed once, not 2*n+1 times. --- Python/compile.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Python/compile.c b/Python/compile.c index fa53b1e..2966532 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1376,7 +1376,6 @@ com_list_for(struct compiling *c, node *n, node *e, char *t) com_node(c, CHILD(n, 3)); /* expr */ com_addbyte(c, GET_ITER); c->c_begin = c->c_nexti; - com_addoparg(c, SET_LINENO, n->n_lineno); com_addfwref(c, FOR_ITER, &anchor); com_push(c, 1); com_assign(c, CHILD(n, 1), OP_ASSIGN, NULL); @@ -1395,7 +1394,6 @@ com_list_if(struct compiling *c, node *n, node *e, char *t) int anchor = 0; int a = 0; /* list_iter: 'if' test [list_iter] */ - com_addoparg(c, SET_LINENO, n->n_lineno); com_node(c, CHILD(n, 1)); com_addfwref(c, JUMP_IF_FALSE, &a); com_addbyte(c, POP_TOP); -- cgit v0.12