diff options
author | David Symonds <dsymonds@golang.org> | 2011-08-04 16:22:22 +1000 |
---|---|---|
committer | David Symonds <dsymonds@golang.org> | 2011-08-04 16:22:22 +1000 |
commit | bb8e36b4a12b16302abf557ccb7aba6965a3ddaf (patch) | |
tree | 84780a021dd229be22916ea335b7d06769856805 | |
parent | 19e80b0818e6f17e03a96f589abb2571421c63c2 (diff) | |
download | go-bb8e36b4a12b16302abf557ccb7aba6965a3ddaf.tar.gz go-bb8e36b4a12b16302abf557ccb7aba6965a3ddaf.zip |
gob: avoid a couple of init-time allocations.
R=r
CC=golang-dev
https://golang.org/cl/4806049
-rw-r--r-- | src/pkg/gob/type.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 |