mirror of https://github.com/python/cpython
Remove unnecessary modulo division.
The preceding test guarantees that 0 <= i < len.
This commit is contained in:
parent
01612e7dec
commit
0913166da2
|
@ -98,7 +98,7 @@ range_item(rangeobject *r, Py_ssize_t i)
|
||||||
"xrange object index out of range");
|
"xrange object index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return PyInt_FromSsize_t(r->start + (i % r->len) * r->step);
|
return PyInt_FromSsize_t(r->start + i * r->step);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Py_ssize_t
|
static Py_ssize_t
|
||||||
|
|
Loading…
Reference in New Issue