mirror of
https://github.com/json-iterator/go.git
synced 2025-05-19 21:53:05 +02:00
flush when buffer is large enough
This commit is contained in:
parent
9e8238cdc6
commit
dcb78991c4
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user