Kaydet (Commit) b0fe3a93 authored tarafından Guido van Rossum's avatar Guido van Rossum

added reverselist; free recycling bin on error exit

üst 3535f6e0
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment