diff --git a/progress.go b/progress.go index 7329134..014a0e4 100644 --- a/progress.go +++ b/progress.go @@ -14,8 +14,6 @@ "github.com/vbauerster/mpb/v8/decor" ) -// buffer capacity allocated per bar structure (prepend|filler|append) -const initialStructBufCap = 256 const defaultRefreshRate = 150 * time.Millisecond // DoneError represents use after `(*Progress).Wait()` error. @@ -467,9 +465,9 @@ } } - for i := 0; i < len(bs.buffers); i++ { - bs.buffers[i] = bytes.NewBuffer(make([]byte, 0, initialStructBufCap)) - } + bs.buffers[0] = bytes.NewBuffer(make([]byte, 0, 128)) // prepend + bs.buffers[1] = bytes.NewBuffer(make([]byte, 0, 128)) // append + bs.buffers[2] = bytes.NewBuffer(make([]byte, 0, 256)) // filler return bs }