1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00

use iterator from cache for any

This commit is contained in:
Tao Wen
2017-06-17 21:10:08 +08:00
parent 50e4910c63
commit 55fc498d27
8 changed files with 82 additions and 121 deletions

View File

@ -8,8 +8,8 @@ import (
type int64LazyAny struct {
baseAny
cfg *frozenConfig
buf []byte
iter *Iterator
err error
cache int64
}
@ -19,7 +19,8 @@ func (any *int64LazyAny) ValueType() ValueType {
}
func (any *int64LazyAny) Parse() *Iterator {
iter := any.iter
iter := any.cfg.BorrowIterator(any.buf)
defer any.cfg.ReturnIterator(iter)
if iter == nil {
iter = NewIterator(ConfigDefault)
}