[pypy-commit] pypy py3k: use fixedview here

pjenvey noreply at buildbot.pypy.org
Wed Dec 19 00:44:58 CET 2012


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r59496:1f72131c8e9a
Date: 2012-12-18 15:38 -0800
http://bitbucket.org/pypy/pypy/changeset/1f72131c8e9a/

Log:	use fixedview here

diff --git a/pypy/objspace/std/longtype.py b/pypy/objspace/std/longtype.py
--- a/pypy/objspace/std/longtype.py
+++ b/pypy/objspace/std/longtype.py
@@ -190,9 +190,9 @@
 
     # result = self - divmod_near(self, 10 ** -ndigits)[1]
     right = rbigint.fromint(10).pow(ndigits.neg())
-    w_temp = divmod_near(space, w_long, newlong(space, right))
-    w_temp2 = space.getitem(w_temp, space.wrap(1))
-    return space.sub(w_long, w_temp2)
+    w_tuple = divmod_near(space, w_long, newlong(space, right))
+    _, w_r = space.fixedview(w_tuple, 2)
+    return space.sub(w_long, w_r)
 
 # ____________________________________________________________
 


More information about the pypy-commit mailing list