Commit 9173a095 authored by Andrew Gerrand's avatar Andrew Gerrand

bufio: make Flush a no-op when the buffer is empty

R=r
CC=golang-dev
https://golang.org/cl/4119048
parent 3bfd35b7
......@@ -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
......
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