]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
LOAD_FAST: rearrange branches to favor the expected case, and get
authorTim Peters <tim.peters@gmail.com>
Tue, 12 Feb 2002 04:31:21 +0000 (04:31 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 12 Feb 2002 04:31:21 +0000 (04:31 +0000)
rid of a redundant NULL-pointer check in the expected case.

Python/ceval.c

index c59f31c07ee01bc52b2efef43beef7390b66b525..202c868fc195c3c86c952e6ba148b03a8e06eedd 100644 (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: