Skip to content

Commit 696b2fe

Browse files
authored
Merge branch 'master' into patch-4
2 parents 5154e29 + 6b8e130 commit 696b2fe

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
test:
66
strategy:
77
matrix:
8-
go: [ 1.17, 1.16, 1.15 ]
8+
go: [ 1.18, 1.17, 1.16, 1.15 ]
99
name: Tests Go ${{ matrix.go }}
1010
runs-on: ubuntu-18.04
1111

utils/bytes_buffer_pool.go

+2-14
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,17 @@ var (
1515
return &bytes.Buffer{}
1616
},
1717
}
18-
bytesBufferChan = make(chan *bytes.Buffer, 10)
1918
)
2019

2120
func BytesBufferGet() (data *bytes.Buffer) {
22-
select {
23-
case data = <-bytesBufferChan:
24-
default:
25-
data = bytesBufferPool.Get().(*bytes.Buffer)
26-
}
27-
21+
data = bytesBufferPool.Get().(*bytes.Buffer)
2822
data.Reset()
29-
3023
return data
3124
}
3225

3326
func BytesBufferPut(data *bytes.Buffer) {
3427
if data == nil || data.Len() > TooBigBlockSize {
3528
return
3629
}
37-
38-
select {
39-
case bytesBufferChan <- data:
40-
default:
41-
bytesBufferPool.Put(data)
42-
}
30+
bytesBufferPool.Put(data)
4331
}

0 commit comments

Comments
 (0)