aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/decode.go
diff options
context:
space:
mode:
authorTim Cooper <tim.cooper@layeh.com>2018-06-19 12:34:17 -0300
committerBrad Fitzpatrick <bradfitz@golang.org>2018-08-21 02:38:02 +0000
commitdc272a4393dc2ba5f54f9cc37670d5581b6e774f (patch)
treee45d824fa4b3966ace17d50e7265b924d0c30245 /src/encoding/json/decode.go
parent3333b6407d8bae64cb8bf62de1425abd8714a51c (diff)
downloadgo-dc272a4393dc2ba5f54f9cc37670d5581b6e774f.tar.xz
encoding/json: call reflect.TypeOf with nil pointers rather than allocating
Updates #26775 Change-Id: I83c9eeda59769d2f35e0cc98f3a8579861d5978b Reviewed-on: https://go-review.googlesource.com/119715 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/encoding/json/decode.go')
-rw-r--r--src/encoding/json/decode.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go
index 0b29249218..97fee54f4e 100644
--- a/src/encoding/json/decode.go
+++ b/src/encoding/json/decode.go
@@ -611,7 +611,7 @@ func (d *decodeState) array(v reflect.Value) error {
}
var nullLiteral = []byte("null")
-var textUnmarshalerType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem()
+var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
// object consumes an object from d.data[d.off-1:], decoding into v.
// The first byte ('{') of the object has been read already.