Author: stian
Branch: math-improvements
Changeset: r92838:2a90db93be84
Date: 2017-10-24 15:03 +0200
http://bitbucket.org/pypy/pypy/changeset/2a90db93be84/

Log:    replace construction of a onedigit with premade, and mark sign and
        size as immutable (which is true post contruction)

diff --git a/rpython/rlib/rbigint.py b/rpython/rlib/rbigint.py
--- a/rpython/rlib/rbigint.py
+++ b/rpython/rlib/rbigint.py
@@ -143,7 +143,7 @@
 class rbigint(object):
     """This is a reimplementation of longs using a list of digits."""
     _immutable_ = True
-    _immutable_fields_ = ["_digits"]
+    _immutable_fields_ = ["_digits", "size", "sign"]
     
     def __init__(self, digits=NULLDIGITS, sign=0, size=0):
         if not we_are_translated():
@@ -1033,7 +1033,7 @@
         # At this point a, b, and c are guaranteed non-negative UNLESS
         # c is NULL, in which case a may be negative. */
 
-        z = rbigint([ONEDIGIT], 1, 1)
+        z = ONERBIGINT
 
         # python adaptation: moved macros REDUCE(X) and MULT(X, Y, result)
         # into helper function result = _help_mult(x, y, c)
@@ -1168,7 +1168,7 @@
         # At this point a, b, and c are guaranteed non-negative UNLESS
         # c is NULL, in which case a may be negative. */
 
-        z = rbigint([ONEDIGIT], 1, 1)
+        z = ONERBIGINT
 
         # python adaptation: moved macros REDUCE(X) and MULT(X, Y, result)
         # into helper function result = _help_mult(x, y, c)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to