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

#61 remove internal buffer from numberLazyAny

This commit is contained in:
Tao Wen
2017-06-18 22:48:28 +08:00
parent a84cdaa694
commit 15c92d48df
6 changed files with 104 additions and 301 deletions

View File

@ -158,17 +158,9 @@ func (iter *Iterator) readAny() Any {
func (iter *Iterator) readNumberAny(positive bool) Any {
iter.startCapture(iter.head - 1)
dotFound := iter.skipNumberAndTellDotFoundOrNot()
iter.skipNumber()
lazyBuf := iter.stopCapture()
if dotFound {
return &float64LazyAny{baseAny{}, iter.cfg, lazyBuf, nil, 0}
} else {
if positive {
return &uint64LazyAny{baseAny{}, iter.cfg, lazyBuf, nil, 0}
} else {
return &int64LazyAny{baseAny{}, iter.cfg, lazyBuf, nil, 0}
}
}
return &numberLazyAny{baseAny{}, iter.cfg, lazyBuf, nil}
}
func (iter *Iterator) readObjectAny() Any {