1. Victor Farazdagi
  2. pypy

Commits

Brian Kearns  committed 059a8fe

more updates to lib_pypy/_collections.py from raymondh

  • Participants
  • Parent commits 4846add
  • Branches default

Comments (0)

Files changed (1)

File lib_pypy/_collections.py

View file
 
     def rotate(self, n=1):
         length = len(self)
-        if length == 0:
+        if length <= 1:
             return
-        halflen = (length+1) >> 1
+        halflen = length >> 1
         if n > halflen or n < -halflen:
             n %= length
             if n > halflen: