Skip to content

Commit daf3a1b

Browse files
committed
remove unused fileds. bs [][]byte
1 parent bb3464e commit daf3a1b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/buffer/ring/ring_buffer.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ var ErrIsEmpty = errors.New("ring-buffer is empty")
4646

4747
// Buffer is a circular buffer that implement io.ReaderWriter interface.
4848
type Buffer struct {
49-
bs [][]byte
5049
buf []byte
5150
size int
5251
r int // next position to read
@@ -57,11 +56,10 @@ type Buffer struct {
5756
// New returns a new Buffer whose buffer has the given size.
5857
func New(size int) *Buffer {
5958
if size == 0 {
60-
return &Buffer{bs: make([][]byte, 2), isEmpty: true}
59+
return &Buffer{isEmpty: true}
6160
}
6261
size = math.CeilToPowerOfTwo(size)
6362
return &Buffer{
64-
bs: make([][]byte, 2),
6563
buf: make([]byte, size),
6664
size: size,
6765
isEmpty: true,

0 commit comments

Comments
 (0)