diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-02-12 04:31:21 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-02-12 04:31:21 (GMT) |
commit | 373f8d81ff1a8c8fa50e8e2ecf15dfd484b9f9e5 (patch) | |
tree | 6b5e8e1bd3033e540fc2e3d9a986b3b06e44aca0 /Python/ceval.c | |
parent | 7ba5e810fd7d7bbfcf5aeffcf2f397398d562c32 (diff) | |
download | cpython-373f8d81ff1a8c8fa50e8e2ecf15dfd484b9f9e5.zip cpython-373f8d81ff1a8c8fa50e8e2ecf15dfd484b9f9e5.tar.gz cpython-373f8d81ff1a8c8fa50e8e2ecf15dfd484b9f9e5.tar.bz2 |
LOAD_FAST: rearrange branches to favor the expected case, and get
rid of a redundant NULL-pointer check in the expected case.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index c59f31c..202c868 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: |