mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
0babdad17b
* chore: upgrade go-waku to v0.5 * chore: add println and logs to check what's being stored in the enr, and preemptively delete the multiaddr field (#3219) * feat: add wakuv2 test (#3218)
25 lines
360 B
Go
25 lines
360 B
Go
package bpool
|
|
|
|
import (
|
|
"bytes"
|
|
"sync"
|
|
)
|
|
|
|
var bpool sync.Pool
|
|
|
|
// Get returns a buffer from the pool or creates a new one if
|
|
// the pool is empty.
|
|
func Get() *bytes.Buffer {
|
|
b := bpool.Get()
|
|
if b == nil {
|
|
return &bytes.Buffer{}
|
|
}
|
|
return b.(*bytes.Buffer)
|
|
}
|
|
|
|
// Put returns a buffer into the pool.
|
|
func Put(b *bytes.Buffer) {
|
|
b.Reset()
|
|
bpool.Put(b)
|
|
}
|