mirror of https://github.com/python/cpython
Inverted test for small speedup
This commit is contained in:
parent
b0dc1a38a1
commit
e53e7a2c7d
|
@ -116,11 +116,10 @@ range_getiter(rangeobject *r)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
range_next(rangeobject *r)
|
range_next(rangeobject *r)
|
||||||
{
|
{
|
||||||
if (r->index >= r->len) {
|
if (r->index < r->len)
|
||||||
PyErr_SetObject(PyExc_StopIteration, Py_None);
|
return PyInt_FromLong(r->start + (r->index++) * r->step);
|
||||||
return NULL;
|
PyErr_SetObject(PyExc_StopIteration, Py_None);
|
||||||
}
|
return NULL;
|
||||||
return PyInt_FromLong(r->start + (r->index++) * r->step);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef range_methods[] = {
|
static PyMethodDef range_methods[] = {
|
||||||
|
|
Loading…
Reference in New Issue