diff options
| author | Ian Lance Taylor <iant@golang.org> | 2023-07-31 15:18:12 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-08-01 14:30:02 +0000 |
| commit | 56d3e84bb0195913e1d932d6fe8251047091076b (patch) | |
| tree | 7dd24d6872c1ce6ef7b167af5cfc88f1991ecb5e /src/encoding/json/bench_test.go | |
| parent | db25bc19e5221c7df2caed3b1daeda673ec757d9 (diff) | |
| download | go-56d3e84bb0195913e1d932d6fe8251047091076b.tar.xz | |
encoding/json: use reflect.TypeFor for known types
For #60088
Change-Id: I2e471c76de62944b14472966b63f5778124b9b8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/514655
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Diffstat (limited to 'src/encoding/json/bench_test.go')
| -rw-r--r-- | src/encoding/json/bench_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/bench_test.go b/src/encoding/json/bench_test.go index bafccdf193..b7e2b6974a 100644 --- a/src/encoding/json/bench_test.go +++ b/src/encoding/json/bench_test.go @@ -450,7 +450,7 @@ func BenchmarkTypeFieldsCache(b *testing.B) { // Dynamically generate many new types. types := make([]reflect.Type, maxTypes) fs := []reflect.StructField{{ - Type: reflect.TypeOf(""), + Type: reflect.TypeFor[string](), Index: []int{0}, }} for i := range types { |
