mirror of
https://github.com/fumiama/orbyte.git
synced 2026-06-09 04:30:30 +08:00
feat(pbuf): add api HasInit
This commit is contained in:
@@ -41,6 +41,12 @@ func (bufferPool BufferPool) ParseBytes(b ...byte) Bytes {
|
|||||||
return Bytes{buf: buf, dat: buf.Pointer().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().
|
// Trans please refer to Item.Trans().
|
||||||
func (b Bytes) Trans() (tb Bytes) {
|
func (b Bytes) Trans() (tb Bytes) {
|
||||||
tb.buf = b.buf.Trans()
|
tb.buf = b.buf.Trans()
|
||||||
|
|||||||
Reference in New Issue
Block a user