We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc8ac4c commit 8828185Copy full SHA for 8828185
json/codec.go
@@ -4,6 +4,7 @@ import (
4
"encoding"
5
"encoding/json"
6
"fmt"
7
+ "maps"
8
"math/big"
9
"reflect"
10
"sort"
@@ -73,12 +74,9 @@ func cacheLoad() map[unsafe.Pointer]codec {
73
74
75
func cacheStore(typ reflect.Type, cod codec, oldCodecs map[unsafe.Pointer]codec) {
76
newCodecs := make(map[unsafe.Pointer]codec, len(oldCodecs)+1)
77
+ maps.Copy(newCodecs, oldCodecs)
78
newCodecs[typeid(typ)] = cod
79
- for t, c := range oldCodecs {
- newCodecs[t] = c
80
- }
81
-
82
cache.Store(&newCodecs)
83
}
84
0 commit comments