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 fe1294f commit 5535416Copy full SHA for 5535416
shared_buffer_pool.go
@@ -121,12 +121,8 @@ type bufferPool struct {
121
func (p *bufferPool) Get(size int) []byte {
122
bs := p.Pool.Get().(*[]byte)
123
124
- // If default size is 0. It means this pool is fallback pool.
125
- // Therefore, we need to make a new one if the requested size is larger than the buffer.
126
- if p.defaultSize == 0 {
127
- if cap(*bs) < size {
128
- *bs = make([]byte, size)
129
- }
+ if cap(*bs) < size {
+ *bs = make([]byte, size)
130
}
131
132
return (*bs)[:size]
0 commit comments