Author: Carl Friedrich Bolz <[email protected]>
Branch: 
Changeset: r48727:6418ef5bfbf7
Date: 2011-11-03 20:09 +0100
http://bitbucket.org/pypy/pypy/changeset/6418ef5bfbf7/

Log:    these loops are unrolled anyway, directly access the correct
        attribute instead of going through a switch again.

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
@@ -71,7 +71,7 @@
             if self.length() != w_other.length():
                 return space.w_False
             for i in iter_n:
-                item1 = self.getitem(i)
+                item1 = getattr(self,'w_value%s' % i)
                 item2 = w_other.getitem(i)
                 if not space.eq_w(item1, item2):
                     return space.w_False
@@ -82,7 +82,7 @@
             x = 0x345678
             z = self.length()
             for i in iter_n:
-                w_item = self.getitem(i)
+                w_item = getattr(self, 'w_value%s' % i)
                 y = space.int_w(space.hash(w_item))
                 x = (x ^ y) * mult
                 z -= 1
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to