1
0
mirror of https://github.com/fumiama/orbyte.git synced 2026-06-05 02:00:30 +08:00

feat(pbuf): add api HasInit

This commit is contained in:
源文雨
2025-02-25 16:53:38 +09:00
parent 309b51a50e
commit 4ebfc3e836

View File

@@ -41,6 +41,12 @@ func (bufferPool BufferPool) ParseBytes(b ...byte) Bytes {
return Bytes{buf: buf, dat: buf.Pointer().Bytes()}
}
// HasInit whether this Bytes is made by pool or
// just declared.
func (b Bytes) HasInit() bool {
return b.buf != nil
}
// Trans please refer to Item.Trans().
func (b Bytes) Trans() (tb Bytes) {
tb.buf = b.buf.Trans()