]> granicus.if.org Git - python/commitdiff
Minor code fixup. Make sure that len reflects the current list size.
authorRaymond Hettinger <python@rcn.com>
Sat, 8 Nov 2003 11:35:22 +0000 (11:35 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 8 Nov 2003 11:35:22 +0000 (11:35 +0000)
Objects/listobject.c

index cf00ab24a8b7acb5df887d9979763e2934412eb7..7198e3481afc7e5ae3da2537a50d0badd80b7979 100644 (file)
@@ -1968,6 +1968,7 @@ fail:
        merge_freemem(&ms);
 
        if (keyfunc != NULL) {
+               len = PyList_GET_SIZE(self);
                for (i=0 ; i < len ; i++) {
                        kvpair = PyList_GET_ITEM(self, i);
                        value = sortwrapper_getvalue(kvpair);