diff options
author | dchapes <dchapes@users.noreply.github.com> | 2017-02-11 14:45:20 -0500 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2017-02-11 14:45:20 -0500 |
commit | 6ac7d2caee89cdfdb4f6c273a88d1173d234c21b (patch) | |
tree | 755bc42811eaa0654b1550a09975013c106c0ea5 /image/golang-gopher.png | |
parent | 328db88096525175c22c4337b54cc9d809332c4a (diff) |
Accept interfaces where appropriate. (#103)
* Accept interfaces where appropriate.
`Fpdf.RawWriteBuf` only needs an `io.Reader`, it doesn't have to be a `bytes.Buffer`.
The only reason I can see not to do this is to avoid the interface "boxing" if the caller is actually using a `bytes.Buffer`;
however, since eventually this gets into `binary.Read` which takes an `io.Reader` the boxing will happen anyway (and possibly repeatedly if `readByte` gets called a number of times; I didn't bother to check).
* Also use interface for segmentRead
* Use read-only bytes.Reader instead of bytes.Buffer where appropriate.
Diffstat (limited to 'image/golang-gopher.png')
0 files changed, 0 insertions, 0 deletions