diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-05-09 05:38:56 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-05-09 05:38:56 (GMT) |
commit | b255069d43f44cb5fee978edf580923979f38826 (patch) | |
tree | c8991dee0057e53bcdcad8dcb0e6914d75e85757 | |
parent | e854e765f40a7af814fc9ba0c57b7877eaeb21f9 (diff) | |
download | cpython-b255069d43f44cb5fee978edf580923979f38826.zip cpython-b255069d43f44cb5fee978edf580923979f38826.tar.gz cpython-b255069d43f44cb5fee978edf580923979f38826.tar.bz2 |
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index bfc6108..d242414 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2899,7 +2899,6 @@ set_exc_info(PyThreadState *tstate, Py_INCREF(Py_None); tstate->exc_type = Py_None; } - tmp_type = frame->f_exc_type; tmp_value = frame->f_exc_value; tmp_tb = frame->f_exc_traceback; Py_XINCREF(tstate->exc_type); @@ -2908,7 +2907,6 @@ set_exc_info(PyThreadState *tstate, frame->f_exc_type = tstate->exc_type; frame->f_exc_value = tstate->exc_value; frame->f_exc_traceback = tstate->exc_traceback; - Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } @@ -2942,7 +2940,7 @@ reset_exc_info(PyThreadState *tstate) tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; - Py_XINCREF(frame->f_exc_type); + Py_INCREF(frame->f_exc_type); Py_XINCREF(frame->f_exc_value); Py_XINCREF(frame->f_exc_traceback); tstate->exc_type = frame->f_exc_type; |