[pypy-commit] pypy remove-intlong-smm: maybe less work for the typical path

pjenvey noreply at buildbot.pypy.org
Fri Feb 14 21:12:34 CET 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: remove-intlong-smm
Changeset: r69139:47afe1f67e8f
Date: 2014-02-14 12:03 -0800
http://bitbucket.org/pypy/pypy/changeset/47afe1f67e8f/

Log:	maybe less work for the typical path

diff --git a/pypy/objspace/std/intobject.py b/pypy/objspace/std/intobject.py
--- a/pypy/objspace/std/intobject.py
+++ b/pypy/objspace/std/intobject.py
@@ -498,13 +498,11 @@
         return float(self.intval)
 
     def int(self, space):
-        if (type(self) is not W_IntObject and
-            space.is_overloaded(self, space.w_int, '__int__')):
-            return W_Root.int(self, space)
-        if space.is_w(space.type(self), space.w_int):
+        if type(self) is W_IntObject:
             return self
-        a = self.intval
-        return space.newint(a)
+        if not space.is_overloaded(self, space.w_int, '__int__'):
+            return space.newint(self.intval)
+        return W_Root.int(self, space)
 
 
 def _recover_with_smalllong(space):


More information about the pypy-commit mailing list