[Python-checkins] python/dist/src/Modules pyexpat.c,2.72,2.73

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Fri, 16 Aug 2002 10:01:10 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv13045/Modules

Modified Files:
	pyexpat.c 
Log Message:
Squash a few calls to the hideously expensive PyObject_CallObject(o,a)
-- replace then with slightly faster PyObject_Call(o,a,NULL).  (The
difference is that the latter requires a to be a tuple; the former
allows other values and wraps them in a tuple if necessary; it
involves two more levels of C function calls to accomplish all that.)


Index: pyexpat.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v
retrieving revision 2.72
retrieving revision 2.73
diff -C2 -d -r2.72 -r2.73
*** pyexpat.c	4 Aug 2002 08:24:49 -0000	2.72
--- pyexpat.c	16 Aug 2002 17:01:07 -0000	2.73
***************
*** 830,834 ****
      PyTuple_SET_ITEM(arg, 0, bytes);
  
!     if ((str = PyObject_CallObject(meth, arg)) == NULL)
          goto finally;
  
--- 830,834 ----
      PyTuple_SET_ITEM(arg, 0, bytes);
  
!     if ((str = PyObject_Call(meth, arg, NULL)) == NULL)
          goto finally;