mirror of
https://github.com/json-iterator/go.git
synced 2025-03-26 21:12:40 +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) {
|
||||
available := b.Available()
|
||||
if available < minimal {
|
||||
if available < 128 {
|
||||
if b.n > 1024 {
|
||||
b.Flush()
|
||||
}
|
||||
b.growAtLeast(minimal)
|
||||
|
Loading…
x
Reference in New Issue
Block a user