diff options
author | Raymond Hettinger <python@rcn.com> | 2008-02-08 22:30:04 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-02-08 22:30:04 (GMT) |
commit | 0913166da2629a567c7acdb70511a1b2347000fb (patch) | |
tree | 875a90338230a9a03f5a1747761e3be4c0481766 /Objects | |
parent | 01612e7dec9fcbd0733137aa90f0f21cfa49299f (diff) | |
download | cpython-0913166da2629a567c7acdb70511a1b2347000fb.zip cpython-0913166da2629a567c7acdb70511a1b2347000fb.tar.gz cpython-0913166da2629a567c7acdb70511a1b2347000fb.tar.bz2 |
Remove unnecessary modulo division.
The preceding test guarantees that 0 <= i < len.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/rangeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index c48bee0..da4356b 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -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 |