Commits

Alex Gaynor  committed 48bb139

Try to reduce the number of copies rbigint does, the _normalize call is not necessary because both _x_{add,sub} call it already.

  • Participants
  • Parent commits 563412e

Comments (0)

Files changed (1)

File pypy/rlib/rbigint.py

         else:
             result = _x_sub(other, self)
         result.sign *= other.sign
-        result._normalize()
         return result
 
     def sub(self, other):
         while i > 1 and self.digits[i - 1] == 0:
             i -= 1
         assert i >= 1
-        self.digits = self.digits[:i]
+        if i != self._numdigits():
+            self.digits = self.digits[:i]
         if self._numdigits() == 1 and self.digits[0] == 0:
             self.sign = 0