commit | 0913166da2629a567c7acdb70511a1b2347000fb | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Fri Feb 08 22:30:04 2008 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Fri Feb 08 22:30:04 2008 +0000 |
tree | 875a90338230a9a03f5a1747761e3be4c0481766 | |
parent | 01612e7dec9fcbd0733137aa90f0f21cfa49299f [diff] [blame] |
Remove unnecessary modulo division. The preceding test guarantees that 0 <= i < len.
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 @@ "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