Refactor bufpool methods

This commit is contained in:
PhatPhuckDave
2024-07-23 14:55:48 +02:00
parent a9827f10ce
commit 2759185dbb
4 changed files with 15 additions and 15 deletions

View File

@@ -25,6 +25,7 @@ type (
header PDU_HEADER
}
)
// Hmm the header can be partially encoded
// As in command_status can just be null
// So not 0s, null, non existent, not encoded
@@ -56,9 +57,8 @@ type (
// What are the other 0s?
// Don't know
func (p *PDU_HEADER) Encode() (*[]uint8, error) {
buf := ByteBufferPool.GetBuffer(uint(p.Size()))
buf := ByteBufferPool.Get(uint(p.Size()))
err := p.EncodeInto(buf)
return buf, err
}