[Python-checkins] python/dist/src/Objects listobject.c,2.189,2.190

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Wed Mar 10 06:44:15 EST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6365

Modified Files:
	listobject.c 
Log Message:
Use memcpy() instead of memmove() when the buffers are known to be distinct.



Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.189
retrieving revision 2.190
diff -C2 -d -r2.189 -r2.190
*** listobject.c	10 Mar 2004 10:10:42 -0000	2.189
--- listobject.c	10 Mar 2004 11:44:04 -0000	2.190
***************
*** 519,523 ****
  		p = recycle = NULL;
  	if (d <= 0) { /* Delete -d items; recycle ihigh-ilow items */
! 		memmove(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
  		p += ihigh - ilow;
  		if (d < 0) {
--- 519,523 ----
  		p = recycle = NULL;
  	if (d <= 0) { /* Delete -d items; recycle ihigh-ilow items */
! 		memcpy(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
  		p += ihigh - ilow;
  		if (d < 0) {
***************
*** 538,542 ****
  		memmove(&item[ihigh+d], &item[ihigh],
  			(s - ihigh)*sizeof(PyObject *));
! 		memmove(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
  		p += ihigh - ilow;
  	}
--- 538,542 ----
  		memmove(&item[ihigh+d], &item[ihigh],
  			(s - ihigh)*sizeof(PyObject *));
! 		memcpy(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
  		p += ihigh - ilow;
  	}




More information about the Python-checkins mailing list