diff options
Diffstat (limited to 'libgo/go/io/ioutil/ioutil.go')
-rw-r--r-- | libgo/go/io/ioutil/ioutil.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libgo/go/io/ioutil/ioutil.go b/libgo/go/io/ioutil/ioutil.go index f072b8c754a..31c77299eee 100644 --- a/libgo/go/io/ioutil/ioutil.go +++ b/libgo/go/io/ioutil/ioutil.go @@ -130,12 +130,11 @@ func (devNull) Write(p []byte) (int, error) { return len(p), nil } -var blackHole = make([]byte, 8192) - func (devNull) ReadFrom(r io.Reader) (n int64, err error) { + buf := blackHole() readSize := 0 for { - readSize, err = r.Read(blackHole) + readSize, err = r.Read(buf) n += int64(readSize) if err != nil { if err == io.EOF { |