• Daniel Morsing's avatar
    io: Prioritize WriterTos over ReaderFroms in Copy. · fdc4ce6e
    Daniel Morsing authored
    This only affects calls where both ReaderFrom and WriterTo are implemented. WriterTo can issue one large write, while ReaderFrom must Read until EOF, potentially reallocating when out of memory. With one large Write, the Writer only needs to allocate once.
    
    This also helps in ioutil.Discard since we can avoid copying memory when the Reader implements WriterTo.
    
    R=golang-dev, dsymonds, remyoudompheng, bradfitz
    CC=golang-dev, minux.ma
    https://golang.org/cl/9462044
    fdc4ce6e
Name
Last commit
Last update
..
ioutil Loading commit data...
io.go Loading commit data...
io_test.go Loading commit data...
multi.go Loading commit data...
multi_test.go Loading commit data...
pipe.go Loading commit data...
pipe_test.go Loading commit data...