Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bfc3099

Browse files
committed
Merged revisions 73750 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r73750 | benjamin.peterson | 2009-07-01 19:45:19 -0400 (Wed, 01 Jul 2009) | 1 line small optimization: avoid popping the current block until we have to ........
1 parent 7b82b40 commit bfc3099

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Python/ceval.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,19 +2839,18 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
28392839

28402840
fast_block_end:
28412841
while (why != WHY_NOT && f->f_iblock > 0) {
2842-
PyTryBlock *b = PyFrame_BlockPop(f);
2842+
/* Peek at the current block. */
2843+
PyTryBlock *b = &f->f_blockstack[f->f_iblock - 1];
28432844

28442845
assert(why != WHY_YIELD);
28452846
if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) {
2846-
/* For a continue inside a try block,
2847-
don't pop the block for the loop. */
2848-
PyFrame_BlockSetup(f, b->b_type, b->b_handler,
2849-
b->b_level);
28502847
why = WHY_NOT;
28512848
JUMPTO(PyLong_AS_LONG(retval));
28522849
Py_DECREF(retval);
28532850
break;
28542851
}
2852+
/* Now we have to pop the block. */
2853+
f->f_iblock--;
28552854

28562855
if (b->b_type == EXCEPT_HANDLER) {
28572856
UNWIND_EXCEPT_HANDLER(b);

0 commit comments

Comments
 (0)