mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
3333b6407d
commit
dc272a4393
2 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue