mirror of
https://github.com/golang/go
synced 2024-11-21 20:34:40 -07:00
bufio: make Flush a no-op when the buffer is empty
R=r CC=golang-dev https://golang.org/cl/4119048
This commit is contained in:
parent
3bfd35b72e
commit
9173a09530
@ -385,6 +385,9 @@ func (b *Writer) Flush() os.Error {
|
||||
if b.err != nil {
|
||||
return b.err
|
||||
}
|
||||
if b.n == 0 {
|
||||
return nil
|
||||
}
|
||||
n, e := b.wr.Write(b.buf[0:b.n])
|
||||
if n < b.n && e == nil {
|
||||
e = io.ErrShortWrite
|
||||
|
Loading…
Reference in New Issue
Block a user