mirror of https://github.com/golang/go.git
bufio: fix optimisation test
Fixes #949. R=rsc CC=golang-dev https://golang.org/cl/1886046
This commit is contained in:
parent
fc4ba1546c
commit
4501e18aa5
|
|
@ -392,7 +392,7 @@ func (b *Writer) Write(p []byte) (nn int, err os.Error) {
|
|||
}
|
||||
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.
|
||||
// Write directly from p to avoid copy.
|
||||
n, b.err = b.wr.Write(p)
|
||||
|
|
|
|||
Loading…
Reference in New Issue