File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -349,18 +349,11 @@ func (d *DataChannel) onError(err error) {
349
349
}
350
350
}
351
351
352
- // See https://github.com/pion/webrtc/issues/1516
353
- // nolint:gochecknoglobals
354
- var rlBufPool = sync.Pool {New : func () interface {} {
355
- return make ([]byte , dataChannelBufferSize )
356
- }}
357
-
358
352
func (d * DataChannel ) readLoop () {
353
+ buffer := make ([]byte , dataChannelBufferSize )
359
354
for {
360
- buffer := rlBufPool .Get ().([]byte ) //nolint:forcetypeassert
361
355
n , isString , err := d .dataChannel .ReadDataChannel (buffer )
362
356
if err != nil {
363
- rlBufPool .Put (buffer ) // nolint:staticcheck
364
357
d .setReadyState (DataChannelStateClosed )
365
358
if ! errors .Is (err , io .EOF ) {
366
359
d .onError (err )
@@ -371,8 +364,6 @@ func (d *DataChannel) readLoop() {
371
364
372
365
m := DataChannelMessage {Data : make ([]byte , n ), IsString : isString }
373
366
copy (m .Data , buffer [:n ])
374
- // The 'staticcheck' pragma is a false positive on the part of the CI linter.
375
- rlBufPool .Put (buffer ) // nolint:staticcheck
376
367
377
368
// NB: Why was DataChannelMessage not passed as a pointer value?
378
369
d .onMessage (m ) // nolint:staticcheck
You can’t perform that action at this time.
0 commit comments