summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-04-03 19:05:18 (GMT)
committerGuido van Rossum <guido@python.org>1991-04-03 19:05:18 (GMT)
commit4a450d06c71edaaab12dc983f057a8486ca99a02 (patch)
tree83f30b1ffdc60014a355145b9610fd8b0afc33d5 /Objects/listobject.c
parent66f1fa83f1e9fbad76cf2ab5fb6dfcf1858d561b (diff)
downloadcpython-4a450d06c71edaaab12dc983f057a8486ca99a02.zip
cpython-4a450d06c71edaaab12dc983f057a8486ca99a02.tar.gz
cpython-4a450d06c71edaaab12dc983f057a8486ca99a02.tar.bz2
Swapped list_ass_item and list_ass_slice to satisfy Standard C.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 743951c..e496fcb 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -345,24 +345,6 @@ list_repeat(a, n)
}
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;
int ilow, ihigh;
@@ -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;