Author: Tim Felgentreff <[email protected]>
Branch: 
Changeset: r597:4830ce6194cb
Date: 2014-02-05 10:15 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/4830ce6194cb/

Log:    try to improve byteobject comparisons

diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -796,13 +796,15 @@
         return True
 
     def is_same_object(self, other):
+        if self is other:
+            return True
         # XXX this sounds very wrong to me
-        if not isinstance(other, W_BytesObject):
+        elif not isinstance(other, W_BytesObject):
             return False
         size = self.size()
         if size != other.size():
             return False
-        if size > 256 and self.bytes is not None and other.bytes is not None:
+        elif size > 256 and self.bytes is not None and other.bytes is not None:
             return self.bytes == other.bytes
         else:
             return self.has_same_chars(other, size)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to