[Python-checkins] python/dist/src/Objects listobject.c,2.129,2.130

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Wed, 31 Jul 2002 19:13:39 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv23821/python/objects

Modified Files:
	listobject.c 
Log Message:
Replaced samplesort with a stable, adaptive mergesort.


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.129
retrieving revision 2.130
diff -C2 -d -r2.129 -r2.130
*** listobject.c	29 Jul 2002 14:35:02 -0000	2.129
--- listobject.c	1 Aug 2002 02:13:36 -0000	2.130
***************
*** 756,768 ****
  }
  
! /* New quicksort implementation for arrays of object pointers.
!    Thanks to discussions with Tim Peters. */
  
  /* Comparison function.  Takes care of calling a user-supplied
!    comparison function (any callable Python object).  Calls the
!    standard comparison function, PyObject_RichCompareBool(), if the user-
!    supplied function is NULL.
!    Returns <0 on error, >0 if x < y, 0 if x >= y. */
[...1316 lines suppressed...]
  static PyMethodDef list_methods[] = {
--- 2012,2016 ----
  "L.reverse() -- reverse *IN PLACE*");
  PyDoc_STRVAR(sort_doc,
! "L.sort([cmpfunc]) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1");
  
  static PyMethodDef list_methods[] = {
***************
*** 1658,1662 ****
  	{"reverse",	(PyCFunction)listreverse, METH_NOARGS, reverse_doc},
  	{"sort",	(PyCFunction)listsort, 	  METH_VARARGS, sort_doc},
! 	{NULL,		NULL}		/* sentinel */
  };
  
--- 2024,2028 ----
  	{"reverse",	(PyCFunction)listreverse, METH_NOARGS, reverse_doc},
  	{"sort",	(PyCFunction)listsort, 	  METH_VARARGS, sort_doc},
!  	{NULL,		NULL}		/* sentinel */
  };