throughout: replace bytes.Add and bytes.AddByte with calls to append
R=gri
CC=golang-dev
http://codereview.appspot.com/3418041
diff --git a/proto/decode.go b/proto/decode.go
index 5423895..4eff414 100644
--- a/proto/decode.go
+++ b/proto/decode.go
@@ -36,7 +36,6 @@
*/
import (
- "bytes"
"fmt"
"io"
"os"
@@ -240,7 +239,7 @@
o.buf = *ptr
o.EncodeVarint(uint64(tag<<3 | wire))
- *ptr = bytes.Add(o.buf, obuf[oi:o.index])
+ *ptr = append(o.buf, obuf[oi:o.index]...)
o.buf = obuf
@@ -359,7 +358,7 @@
iv := unsafe.Unreflect(t, unsafe.Pointer(&o.ptr))
if e, ok := iv.(extendableProto); ok && isExtensionField(e, int32(tag)) {
if err = o.skip(st, tag, wire); err == nil {
- e.ExtensionMap()[int32(tag)] = bytes.Add(nil, o.buf[oi:o.index])
+ e.ExtensionMap()[int32(tag)] = append([]byte(nil), o.buf[oi:o.index]...)
}
continue
}