File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -664,24 +664,6 @@ range_iter(PyObject *seq)
664664 PyErr_Clear ();
665665 goto long_range ;
666666 }
667- /* round lstop to the next value congruent to lstart modulo lstep;
668- if the result would overflow, use PyLong version. */
669- if (lstep > 0 && lstart < lstop ) {
670- long extra = (lstep - 1 ) - (long )((lstop - 1UL - lstart ) % lstep );
671- if ((unsigned long )extra > (unsigned long )LONG_MAX - lstop )
672- goto long_range ;
673- lstop += extra ;
674- }
675- else if (lstep < 0 && lstart > lstop ) {
676- long extra = (lstep + 1 ) + (long )((lstart - 1UL - lstop ) %
677- (0UL - lstep ));
678- if ((unsigned long )lstop - LONG_MIN < 0UL - extra )
679- goto long_range ;
680- lstop += extra ;
681- }
682- else
683- lstop = lstart ;
684-
685667 int_it = int_range_iter (lstart , lstop , lstep );
686668 if (int_it == NULL && PyErr_ExceptionMatches (PyExc_OverflowError )) {
687669 PyErr_Clear ();
@@ -778,15 +760,6 @@ range_reverse(PyObject *seq)
778760 goto long_range ;
779761 }
780762
781- /* set lstop equal to the last element of the range, or to lstart if the
782- range is empty. */
783- if (lstep > 0 && lstart < lstop )
784- lstop += -1 - (long )((lstop - 1UL - lstart ) % lstep );
785- else if (lstep < 0 && lstart > lstop )
786- lstop += 1 + (long )((lstart - 1UL - lstop ) % (0UL - lstep ));
787- else
788- lstop = lstart ;
789-
790763 ulen = get_len_of_range (lstart , lstop , lstep );
791764 if (ulen > (unsigned long )LONG_MAX )
792765 goto long_range ;
You can’t perform that action at this time.
0 commit comments