You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-24 23:16:47 +02:00
Merge pull request #368 from alextomaili/fix-memory-allocation-overhead
allocate string for error description only if it really required
This commit is contained in:
@ -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()
|
||||||
|
Reference in New Issue
Block a user