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.
This commit is contained in:
parent
ed6254acf2
commit
13870b18f2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue