diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 10:04:50 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 10:04:50 (GMT) |
commit | bde0508d7596f801b1fb57604f8235ab0df8388d (patch) | |
tree | a0c9ead37bb3a37ea21db2b4d71df8ff32243bf1 /Objects | |
parent | d550c9a281fd9a909f84a4f29d2d9a0be9187685 (diff) | |
download | cpython-bde0508d7596f801b1fb57604f8235ab0df8388d.zip cpython-bde0508d7596f801b1fb57604f8235ab0df8388d.tar.gz cpython-bde0508d7596f801b1fb57604f8235ab0df8388d.tar.bz2 |
r76292 commit accidentally committed some extra code; remove it
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/rangeobject.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index c5885f5..cabe785 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -664,24 +664,6 @@ range_iter(PyObject *seq) PyErr_Clear(); goto long_range; } - /* round lstop to the next value congruent to lstart modulo lstep; - if the result would overflow, use PyLong version. */ - if (lstep > 0 && lstart < lstop) { - long extra = (lstep - 1) - (long)((lstop - 1UL - lstart) % lstep); - if ((unsigned long)extra > (unsigned long)LONG_MAX - lstop) - goto long_range; - lstop += extra; - } - else if (lstep < 0 && lstart > lstop) { - long extra = (lstep + 1) + (long)((lstart - 1UL - lstop) % - (0UL - lstep)); - if ((unsigned long)lstop - LONG_MIN < 0UL - extra) - goto long_range; - lstop += extra; - } - else - lstop = lstart; - int_it = int_range_iter(lstart, lstop, lstep); if (int_it == NULL && PyErr_ExceptionMatches(PyExc_OverflowError)) { PyErr_Clear(); @@ -778,15 +760,6 @@ range_reverse(PyObject *seq) goto long_range; } - /* set lstop equal to the last element of the range, or to lstart if the - range is empty. */ - if (lstep > 0 && lstart < lstop) - lstop += -1 - (long)((lstop - 1UL - lstart) % lstep); - else if (lstep < 0 && lstart > lstop) - lstop += 1 + (long)((lstart - 1UL - lstop) % (0UL - lstep)); - else - lstop = lstart; - ulen = get_len_of_range(lstart, lstop, lstep); if (ulen > (unsigned long)LONG_MAX) goto long_range; |