You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bufio.Writer.Write() has an optimization to pass writes larger than the buffer size
directly to the underlying writer. However, there is a bug. At first it looks sinister,
but really it just disables the optimization.
diff -r af73f0550913 src/pkg/bufio/bufio.go
--- a/src/pkg/bufio/bufio.go Fri Jul 23 12:34:35 2010 -0700
+++ b/src/pkg/bufio/bufio.go Fri Jul 23 17:54:02 2010 -0700
@@ -392,7 +392,8 @@
}
n = b.Available()
}
- if b.Available() == 0 && len(p) >= len(b.buf) {
+ if b.Buffered() == 0 && len(p) >= len(b.buf) {