Commit 4501e18a authored by Andrew Gerrand's avatar Andrew Gerrand

bufio: fix optimisation test

Fixes #949.

R=rsc
CC=golang-dev
https://golang.org/cl/1886046
parent fc4ba154
...@@ -392,7 +392,7 @@ func (b *Writer) Write(p []byte) (nn int, err os.Error) { ...@@ -392,7 +392,7 @@ func (b *Writer) Write(p []byte) (nn int, err os.Error) {
} }
n = b.Available() n = b.Available()
} }
if b.Available() == 0 && len(p) >= len(b.buf) { if b.Buffered() == 0 && len(p) >= len(b.buf) {
// Large write, empty buffer. // Large write, empty buffer.
// Write directly from p to avoid copy. // Write directly from p to avoid copy.
n, b.err = b.wr.Write(p) n, b.err = b.wr.Write(p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment