diff Objects/listobject.c @ 26818:e094a03a80ff legacy-trunk

SF patch #659536: Use PyArg_UnpackTuple where possible. Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
author Raymond Hettinger <python@rcn.com>
date Sun, 29 Dec 2002 16:33:45 +0000
parents 6932794817c2
children 41f7726e3e51
line wrap: on
line diff
--- a/Objects/listobject.c	Sun Dec 29 05:49:09 2002 +0000
+++ b/Objects/listobject.c	Sun Dec 29 16:33:45 2002 +0000
@@ -1654,7 +1654,7 @@
 
 	assert(self != NULL);
 	if (args != NULL) {
-		if (!PyArg_ParseTuple(args, "|O:sort", &compare))
+		if (!PyArg_UnpackTuple(args, "sort", 0, 1, &compare))
 			return NULL;
 	}
 	merge_init(&ms, compare);