From: David Symonds Date: Thu, 4 Aug 2011 06:22:22 +0000 (+1000) Subject: gob: avoid a couple of init-time allocations. X-Git-Tag: weekly.2011-08-10~35 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bb8e36b4a12b16302abf557ccb7aba6965a3ddaf;p=gostls13.git gob: avoid a couple of init-time allocations. R=r CC=golang-dev https://golang.org/cl/4806049 --- diff --git a/src/pkg/gob/type.go b/src/pkg/gob/type.go index 258a01e158..b2f716c4b5 100644 --- a/src/pkg/gob/type.go +++ b/src/pkg/gob/type.go @@ -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