mirror of
https://github.com/json-iterator/go.git
synced 2025-04-23 11:37:32 +02:00
allocate string for error description only if it really required
This commit is contained in:
parent
08047c174c
commit
f71b9090aa
@ -530,8 +530,8 @@ func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *It
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if fieldDecoder == nil {
|
if fieldDecoder == nil {
|
||||||
msg := "found unknown field: " + field
|
|
||||||
if decoder.disallowUnknownFields {
|
if decoder.disallowUnknownFields {
|
||||||
|
msg := "found unknown field: " + field
|
||||||
iter.ReportError("ReadObject", msg)
|
iter.ReportError("ReadObject", msg)
|
||||||
}
|
}
|
||||||
c := iter.nextToken()
|
c := iter.nextToken()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user