Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r63268:7722fa2d82da
Date: 2013-04-12 03:44 -0400
http://bitbucket.org/pypy/pypy/changeset/7722fa2d82da/

Log:    have BytesIO.truncate() reset to fast path (AT_END) when possible

diff --git a/pypy/module/_io/interp_bytesio.py 
b/pypy/module/_io/interp_bytesio.py
--- a/pypy/module/_io/interp_bytesio.py
+++ b/pypy/module/_io/interp_bytesio.py
@@ -73,7 +73,10 @@
                 "negative size value"))
 
         self.truncate(size)
-        self.seek(pos)
+        if size == pos:
+            self.seek(0, 2)
+        else:
+            self.seek(pos)
         return space.wrap(size)
 
     def getvalue_w(self, space):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to