From: Guido van Rossum Date: Tue, 17 Jan 1995 16:34:45 +0000 (+0000) Subject: added reverselist; free recycling bin on error exit X-Git-Tag: v1.2b2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0fe3a9312a9d50f4dde4de351897beb7d39bebf;p=thirdparty%2FPython%2Fcpython.git added reverselist; free recycling bin on error exit --- diff --git a/Objects/listobject.c b/Objects/listobject.c index 5c3d0ed36c56..9c9ed7593b5b 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; } @@ -612,6 +613,21 @@ listreverse(self, args) return None; } +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;