mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
Code optimization
This commit is contained in:
@@ -52,12 +52,6 @@ func GetBufPoolCopy() ([]byte) {
|
||||
return (*BufPoolCopy.Get().(*[]byte))[:PoolSizeCopy]
|
||||
}
|
||||
|
||||
func PutBufPoolSmall(buf []byte) {
|
||||
if cap(buf) == PoolSizeSmall {
|
||||
BufPoolSmall.Put(buf[:PoolSizeSmall])
|
||||
}
|
||||
}
|
||||
|
||||
func PutBufPoolMax(buf []byte) {
|
||||
if cap(buf) == PoolSize {
|
||||
BufPoolMax.Put(buf[:PoolSize])
|
||||
|
Reference in New Issue
Block a user