diff options
author | Guido van Rossum <guido@python.org> | 1995-01-17 16:34:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-17 16:34:45 (GMT) |
commit | b0fe3a9312a9d50f4dde4de351897beb7d39bebf (patch) | |
tree | 4f0958086ba19b9162008efd9cc98c811347fc90 /Objects/listobject.c | |
parent | 3535f6e0a1ca5fb7a7a9f2c4b5a1cf1a125248b8 (diff) | |
download | cpython-b0fe3a9312a9d50f4dde4de351897beb7d39bebf.zip cpython-b0fe3a9312a9d50f4dde4de351897beb7d39bebf.tar.gz cpython-b0fe3a9312a9d50f4dde4de351897beb7d39bebf.tar.bz2 |
added reverselist; free recycling bin on error exit
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 5c3d0ed..9c9ed75 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -427,6 +427,7 @@ list_ass_slice(a, ilow, ihigh, v) else { /* Insert d items; recycle ihigh-ilow items */ RESIZE(item, object *, a->ob_size + d); if (item == NULL) { + XDEL(recycle); err_nomem(); return -1; } @@ -613,6 +614,21 @@ listreverse(self, args) } int +reverselist(v) + object *v; +{ + if (v == NULL || !is_listobject(v)) { + err_badcall(); + return -1; + } + v = listreverse((listobject *)v, (object *)NULL); + if (v == NULL) + return -1; + DECREF(v); + return 0; +} + +int sortlist(v) object *v; { |