mirror of
https://github.com/golang/go
synced 2024-11-20 07:04:40 -07:00
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
Block a user