[Python-checkins] r51403 - python/trunk/Objects/listobject.c

neal.norwitz python-checkins at python.org
Sat Aug 19 06:28:56 CEST 2006


Author: neal.norwitz
Date: Sat Aug 19 06:28:55 2006
New Revision: 51403

Modified:
   python/trunk/Objects/listobject.c
Log:
Move initialization to after the asserts for non-NULL values.

Klocwork 286-287.

(I'm not backporting this, but if someone wants to, feel free.)


Modified: python/trunk/Objects/listobject.c
==============================================================================
--- python/trunk/Objects/listobject.c	(original)
+++ python/trunk/Objects/listobject.c	Sat Aug 19 06:28:55 2006
@@ -1398,7 +1398,7 @@
 	PyObject *compare;
 	PyObject **dest;
 	int result = -1;	/* guilty until proved innocent */
-	Py_ssize_t min_gallop = ms->min_gallop;
+	Py_ssize_t min_gallop;
 
 	assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb);
 	if (MERGE_GETMEM(ms, na) < 0)
@@ -1414,6 +1414,7 @@
 	if (na == 1)
 		goto CopyB;
 
+	min_gallop = ms->min_gallop;
 	compare = ms->compare;
 	for (;;) {
 		Py_ssize_t acount = 0;	/* # of times A won in a row */
@@ -1531,7 +1532,7 @@
 	int result = -1;	/* guilty until proved innocent */
 	PyObject **basea;
 	PyObject **baseb;
-	Py_ssize_t min_gallop = ms->min_gallop;
+	Py_ssize_t min_gallop;
 
 	assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb);
 	if (MERGE_GETMEM(ms, nb) < 0)
@@ -1550,6 +1551,7 @@
 	if (nb == 1)
 		goto CopyA;
 
+	min_gallop = ms->min_gallop;
 	compare = ms->compare;
 	for (;;) {
 		Py_ssize_t acount = 0;	/* # of times A won in a row */


More information about the Python-checkins mailing list