use append

R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
This commit is contained in:
Russ Cox 2010-10-27 19:47:23 -07:00
parent b1f31f442e
commit 8fe46b4768

View File

@ -315,19 +315,6 @@ func (m *serverHelloMsg) marshal() []byte {
return x return x
} }
func append(slice []string, elem string) []string {
if len(slice) < cap(slice) {
slice = slice[0 : len(slice)+1]
slice[len(slice)-1] = elem
return slice
}
fresh := make([]string, len(slice)+1, cap(slice)*2+1)
copy(fresh, slice)
fresh[len(slice)] = elem
return fresh
}
func (m *serverHelloMsg) unmarshal(data []byte) bool { func (m *serverHelloMsg) unmarshal(data []byte) bool {
if len(data) < 42 { if len(data) < 42 {
return false return false