]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Swapped list_ass_item and list_ass_slice to satisfy Standard C.
authorGuido van Rossum <guido@python.org>
Wed, 3 Apr 1991 19:05:18 +0000 (19:05 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 3 Apr 1991 19:05:18 +0000 (19:05 +0000)
Objects/listobject.c

index 743951c5d3a77354f60d66ab539ffcc73e4e8823..e496fcbf9630730e5ea774af93f9f3b2155f2e05 100644 (file)
@@ -344,24 +344,6 @@ list_repeat(a, n)
        return (object *) np;
 }
 
-static int
-list_ass_item(a, i, v)
-       listobject *a;
-       int i;
-       object *v;
-{
-       if (i < 0 || i >= a->ob_size) {
-               err_setstr(IndexError, "list assignment index out of range");
-               return -1;
-       }
-       if (v == NULL)
-               return list_ass_slice(a, i, i+1, v);
-       INCREF(v);
-       DECREF(a->ob_item[i]);
-       a->ob_item[i] = v;
-       return 0;
-}
-
 static int
 list_ass_slice(a, ilow, ihigh, v)
        listobject *a;
@@ -426,6 +408,24 @@ list_ass_slice(a, ilow, ihigh, v)
 #undef b
 }
 
+static int
+list_ass_item(a, i, v)
+       listobject *a;
+       int i;
+       object *v;
+{
+       if (i < 0 || i >= a->ob_size) {
+               err_setstr(IndexError, "list assignment index out of range");
+               return -1;
+       }
+       if (v == NULL)
+               return list_ass_slice(a, i, i+1, v);
+       INCREF(v);
+       DECREF(a->ob_item[i]);
+       a->ob_item[i] = v;
+       return 0;
+}
+
 static object *
 ins(self, where, v)
        listobject *self;