1
0
mirror of https://github.com/golang/go synced 2024-11-24 10:10:07 -07:00

gob: avoid a couple of init-time allocations.

R=r
CC=golang-dev
https://golang.org/cl/4806049
This commit is contained in:
David Symonds 2011-08-04 16:22:22 +10:00
parent 19e80b0818
commit bb8e36b4a1

View File

@ -81,8 +81,8 @@ func validUserType(rt reflect.Type) (ut *userTypeInfo, err os.Error) {
}
var (
gobEncoderInterfaceType = reflect.TypeOf(new(GobEncoder)).Elem()
gobDecoderInterfaceType = reflect.TypeOf(new(GobDecoder)).Elem()
gobEncoderInterfaceType = reflect.TypeOf((*GobEncoder)(nil)).Elem()
gobDecoderInterfaceType = reflect.TypeOf((*GobDecoder)(nil)).Elem()
)
// implementsInterface reports whether the type implements the