From: Tim Peters Date: Tue, 12 Feb 2002 04:31:21 +0000 (+0000) Subject: LOAD_FAST: rearrange branches to favor the expected case, and get X-Git-Tag: v2.3c1~6682 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=373f8d81ff1a8c8fa50e8e2ecf15dfd484b9f9e5;p=thirdparty%2FPython%2Fcpython.git LOAD_FAST: rearrange branches to favor the expected case, and get rid of a redundant NULL-pointer check in the expected case. --- diff --git a/Python/ceval.c b/Python/ceval.c index c59f31c07ee0..202c868fc195 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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: