Commit 13870b18 authored by Thomas Wouters's avatar Thomas Wouters

Also make _heapq.nlargest() use Py_ssize_t instead of ints, to iter over

lists and call Py_ssize_t-using helpers. All other code in this module was
already adapted to Py_ssize_t.
parent ed6254ac
......@@ -227,9 +227,9 @@ static PyObject *
nlargest(PyObject *self, PyObject *args)
{
PyObject *heap=NULL, *elem, *iterable, *sol, *it, *oldelem;
int i, n;
Py_ssize_t i, n;
if (!PyArg_ParseTuple(args, "iO:nlargest", &n, &iterable))
if (!PyArg_ParseTuple(args, "nO:nlargest", &n, &iterable))
return NULL;
it = PyObject_GetIter(iterable);
......
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