mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Remove unnecessary modulo division.
The preceding test guarantees that 0 <= i < len.
This commit is contained in:
parent
01612e7dec
commit
0913166da2
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ range_item(rangeobject *r, Py_ssize_t i)
|
|||
"xrange object index out of range");
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue