You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-07-09 23:45:32 +02:00
Unmarshalling float with lots of digits can cause >= 2 allocations per number
We can fix this with a little bit of scratch space.
This commit is contained in:
7
iter.go
7
iter.go
@ -26,8 +26,10 @@ const (
|
||||
ObjectValue
|
||||
)
|
||||
|
||||
var hexDigits []byte
|
||||
var valueTypes []ValueType
|
||||
var (
|
||||
hexDigits []byte
|
||||
valueTypes []ValueType
|
||||
)
|
||||
|
||||
func init() {
|
||||
hexDigits = make([]byte, 256)
|
||||
@ -78,6 +80,7 @@ type Iterator struct {
|
||||
captureStartedAt int
|
||||
captured []byte
|
||||
Error error
|
||||
scratch []byte
|
||||
Attachment interface{} // open for customized decoder
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user