diff Python/ceval.c @ 38134:eb4879c085aa legacy-trunk

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.
author Neal Norwitz <nnorwitz@gmail.com>
date Tue, 09 May 2006 05:38:56 +0000
parents ce5585afc20f
children 2195972f7391
line wrap: on
line diff
--- a/Python/ceval.c	Mon May 08 17:48:01 2006 +0000
+++ b/Python/ceval.c	Tue May 09 05:38:56 2006 +0000
@@ -2899,7 +2899,6 @@
 			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 @@
 		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 @@
 		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;