mirror of
https://github.com/json-iterator/go.git
synced 2024-11-27 08:30:57 +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:
commit
94869abf43
@ -530,8 +530,8 @@ func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *It
|
||||
}
|
||||
}
|
||||
if fieldDecoder == nil {
|
||||
msg := "found unknown field: " + field
|
||||
if decoder.disallowUnknownFields {
|
||||
msg := "found unknown field: " + field
|
||||
iter.ReportError("ReadObject", msg)
|
||||
}
|
||||
c := iter.nextToken()
|
||||
|
Loading…
Reference in New Issue
Block a user