1
0
mirror of https://github.com/json-iterator/go.git synced 2025-05-13 21:36:29 +02:00

remove quotation check for key when decoding map

we don't need to check if the key is surrounded by quotation.
In fact, the key might not be strings if we register an extension to
customize the map key encoder/decoder.It may be an integer, float, or
even a struct.
This commit is contained in:
allen 2020-05-31 18:18:48 +08:00
parent 55287ed53a
commit cd6773e694

View File

@ -167,10 +167,6 @@ func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
if c == '}' { if c == '}' {
return return
} }
if c != '"' {
iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
return
}
iter.unreadByte() iter.unreadByte()
key := decoder.keyType.UnsafeNew() key := decoder.keyType.UnsafeNew()
decoder.keyDecoder.Decode(key, iter) decoder.keyDecoder.Decode(key, iter)