2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 21:05:10 +00:00

Use rclone.wrappedConn by pointer

This shaves a kilobyte off the Linux binary by not generating a
non-pointer interface implementation.
This commit is contained in:
greatroar 2021-08-01 09:11:50 +02:00
parent 5571c3f7fd
commit fa3eed1998

View File

@ -104,16 +104,16 @@ type wrappedConn struct {
io.Writer
}
func (c wrappedConn) Read(p []byte) (int, error) {
func (c *wrappedConn) Read(p []byte) (int, error) {
return c.Reader.Read(p)
}
func (c wrappedConn) Write(p []byte) (int, error) {
func (c *wrappedConn) Write(p []byte) (int, error) {
return c.Writer.Write(p)
}
func wrapConn(c *StdioConn, lim limiter.Limiter) wrappedConn {
wc := wrappedConn{
func wrapConn(c *StdioConn, lim limiter.Limiter) *wrappedConn {
wc := &wrappedConn{
StdioConn: c,
Reader: c,
Writer: c,