aboutsummaryrefslogtreecommitdiff
path: root/src/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/listobject.c')
-rw-r--r--src/listobject.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/listobject.c b/src/listobject.c
index be1382c..9a32eac 100644
--- a/src/listobject.c
+++ b/src/listobject.c
@@ -25,6 +25,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* List object implementation */
#include "allobjects.h"
+#include "modsupport.h"
object *
newlistobject(size)
@@ -319,24 +320,6 @@ list_concat(a, bb)
}
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;
@@ -400,6 +383,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;