You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-07-03 23:30:41 +02:00
flush when buffer is large enough
This commit is contained in:
@ -164,7 +164,7 @@ func (b *Stream) Flush() error {
|
|||||||
func (b *Stream) ensure(minimal int) {
|
func (b *Stream) ensure(minimal int) {
|
||||||
available := b.Available()
|
available := b.Available()
|
||||||
if available < minimal {
|
if available < minimal {
|
||||||
if available < 128 {
|
if b.n > 1024 {
|
||||||
b.Flush()
|
b.Flush()
|
||||||
}
|
}
|
||||||
b.growAtLeast(minimal)
|
b.growAtLeast(minimal)
|
||||||
|
Reference in New Issue
Block a user