Skip to content

Commit

Permalink
Use rclone.wrappedConn by pointer
Browse files Browse the repository at this point in the history
This shaves a kilobyte off the Linux binary by not generating a
non-pointer interface implementation.
  • Loading branch information
greatroar committed Aug 1, 2021
1 parent 5571c3f commit fa3eed1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/backend/rclone/backend.go
Expand Up @@ -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,
Expand Down

0 comments on commit fa3eed1

Please sign in to comment.