[Python-checkins] cpython: Micro-optimize PyObject_GetAttrString()

victor.stinner python-checkins at python.org
Thu Mar 22 02:09:39 CET 2012


http://hg.python.org/cpython/rev/059489cec7b9
changeset:   75866:059489cec7b9
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Mar 22 02:09:08 2012 +0100
summary:
  Micro-optimize PyObject_GetAttrString()

w cannot be NULL so use Py_DECREF() instead of Py_XDECREF().

files:
  Objects/object.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/object.c b/Objects/object.c
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -820,7 +820,7 @@
     if (w == NULL)
         return NULL;
     res = PyObject_GetAttr(v, w);
-    Py_XDECREF(w);
+    Py_DECREF(w);
     return res;
 }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list