From 13870b18f2a843d568f82c89b72f33dc427b9b23 Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Thu, 16 Feb 2006 19:21:53 +0000 Subject: 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. --- Modules/_heapqmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/_heapqmodule.c') diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index 36427690b1..f970cae913 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -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); -- cgit v1.2.1