summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2002-07-25 06:18:42 (GMT)
committerSkip Montanaro <skip@pobox.com>2002-07-25 06:18:42 (GMT)
commit21ee37c94e78e43adabf178c53401cebde4ce96f (patch)
tree942c0688a42489b03a344040e3d2b439f081bb6b /Python
parentf8c8cf8a9d8b9136571b65e82f95e136fd0374e8 (diff)
downloadcpython-21ee37c94e78e43adabf178c53401cebde4ce96f.zip
cpython-21ee37c94e78e43adabf178c53401cebde4ce96f.tar.gz
cpython-21ee37c94e78e43adabf178c53401cebde4ce96f.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c2
1 files changed, 0 insertions, 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);