Merge pull request #14767 from bboreham/fix-encoding-comment

[Comment] Correct the comment on Decbuf.UvarintBytes
This commit is contained in:
Bryan Boreham 2024-09-09 12:52:36 +01:00 committed by GitHub
commit 16e5e99546
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,8 +201,9 @@ func (d *Decbuf) UvarintStr() string {
return string(d.UvarintBytes()) return string(d.UvarintBytes())
} }
// UvarintBytes returns invalid values if the byte slice goes away. // UvarintBytes returns a pointer to internal data;
// Compared to UvarintStr, it avoid allocations. // the return value becomes invalid if the byte slice goes away.
// Compared to UvarintStr, this avoids allocations.
func (d *Decbuf) UvarintBytes() []byte { func (d *Decbuf) UvarintBytes() []byte {
l := d.Uvarint64() l := d.Uvarint64()
if d.E != nil { if d.E != nil {