We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb3464e commit daf3a1bCopy full SHA for daf3a1b
pkg/buffer/ring/ring_buffer.go
@@ -46,7 +46,6 @@ var ErrIsEmpty = errors.New("ring-buffer is empty")
46
47
// Buffer is a circular buffer that implement io.ReaderWriter interface.
48
type Buffer struct {
49
- bs [][]byte
50
buf []byte
51
size int
52
r int // next position to read
@@ -57,11 +56,10 @@ type Buffer struct {
57
56
// New returns a new Buffer whose buffer has the given size.
58
func New(size int) *Buffer {
59
if size == 0 {
60
- return &Buffer{bs: make([][]byte, 2), isEmpty: true}
+ return &Buffer{isEmpty: true}
61
}
62
size = math.CeilToPowerOfTwo(size)
63
return &Buffer{
64
- bs: make([][]byte, 2),
65
buf: make([]byte, size),
66
size: size,
67
isEmpty: true,
0 commit comments