LOAD_FAST: rearrange branches to favor the expected case, and get

rid of a redundant NULL-pointer check in the expected case.
This commit is contained in:
Tim Peters 2002-02-12 04:31:21 +00:00
parent 7ba5e810fd
commit 373f8d81ff
1 changed files with 7 additions and 10 deletions

View File

@ -1666,17 +1666,14 @@ eval_frame(PyFrameObject *f)
case LOAD_FAST:
x = GETLOCAL(oparg);
if (x == NULL) {
format_exc_check_arg(
PyExc_UnboundLocalError,
UNBOUNDLOCAL_ERROR_MSG,
PyTuple_GetItem(co->co_varnames, oparg)
);
break;
if (x != NULL) {
Py_INCREF(x);
PUSH(x);
continue;
}
Py_INCREF(x);
PUSH(x);
if (x != NULL) continue;
format_exc_check_arg(PyExc_UnboundLocalError,
UNBOUNDLOCAL_ERROR_MSG,
PyTuple_GetItem(co->co_varnames, oparg));
break;
case STORE_FAST: