mirror of
https://github.com/ehang-io/nps.git
synced 2026-11-01 17:30:20 +08:00
Code optimization
This commit is contained in:
1 parent
4b0aebd6a5
commit
cc6d053b6d
32 files changed
+357
-289
No files matched your search
@@ -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