[pypy-commit] pypy default: similarly, no need to call length here

cfbolz noreply at buildbot.pypy.org
Fri Nov 4 10:50:18 CET 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r48728:c15bbb59c756
Date: 2011-11-03 20:11 +0100
http://bitbucket.org/pypy/pypy/changeset/c15bbb59c756/

Log:	similarly, no need to call length here

diff --git a/pypy/objspace/std/smalltupleobject.py b/pypy/objspace/std/smalltupleobject.py
--- a/pypy/objspace/std/smalltupleobject.py
+++ b/pypy/objspace/std/smalltupleobject.py
@@ -68,7 +68,7 @@
             raise IndexError
 
         def eq(self, space, w_other):
-            if self.length() != w_other.length():
+            if n != w_other.length():
                 return space.w_False
             for i in iter_n:
                 item1 = getattr(self,'w_value%s' % i)
@@ -80,7 +80,7 @@
         def hash(self, space):
             mult = 1000003
             x = 0x345678
-            z = self.length()
+            z = n
             for i in iter_n:
                 w_item = getattr(self, 'w_value%s' % i)
                 y = space.int_w(space.hash(w_item))


More information about the pypy-commit mailing list