Skip to content

Commit

Permalink
remove quotation check for key when decoding map
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AllenX2018 committed May 31, 2020
1 parent cf3c011 commit 5e044c3
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions reflect_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
if c == '}' {
return
}
if c != '"' {
iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
return
}
iter.unreadByte()
key := decoder.keyType.UnsafeNew()
decoder.keyDecoder.Decode(key, iter)
Expand Down

0 comments on commit 5e044c3

Please sign in to comment.