Author: Brian Kearns <[email protected]>
Branch:
Changeset: r61227:2a03b3b62fba
Date: 2013-02-13 19:04 -0500
http://bitbucket.org/pypy/pypy/changeset/2a03b3b62fba/
Log: optimize LineBufOut.write to only produce a single underlying write
in all cases
diff --git a/rpython/rlib/streamio.py b/rpython/rlib/streamio.py
--- a/rpython/rlib/streamio.py
+++ b/rpython/rlib/streamio.py
@@ -795,8 +795,10 @@
self.buflen += len(data)
else:
if self.buflen:
+ self.buf.append(data[:p])
self.do_write(''.join(self.buf))
- self.do_write(data[:p])
+ else:
+ self.do_write(data[:p])
self.buf = [data[p:]]
self.buflen = len(self.buf[0])
else:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit