Index: src/0dev.org/encoding/fibonacci/fib.go ================================================================== --- src/0dev.org/encoding/fibonacci/fib.go +++ src/0dev.org/encoding/fibonacci/fib.go @@ -100,10 +100,11 @@ return &enc } type encoder struct { target io.Writer + buffer [2]byte remaining byte length byte } // Implements io.Writer @@ -143,11 +144,11 @@ } // Clearing e.length is not necessary as it will be overwritten later // Stage the complete byte for writing - buffer := make([]byte, 1, 2) + buffer := e.buffer[:1] buffer[0] = byte(e.remaining) // Stage every full byte from the encoded value for writing // // The bitlength of the largest encoded byte value, 255, is 13.