This commit is contained in:
Aliaksandr Valialkin 2024-05-11 01:40:22 +02:00
parent 1e7090cc8e
commit 3d8060e302
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -34,6 +34,10 @@ func (a *arena) sizeBytes() int {
}
func (a *arena) copyBytes(b []byte) []byte {
if len(b) == 0 {
return b
}
ab := a.b
abLen := len(ab)
ab = append(ab, b...)
@ -53,6 +57,10 @@ func (a *arena) copyString(s string) string {
}
func (a *arena) newBytes(size int) []byte {
if size <= 0 {
return nil
}
ab := a.b
abLen := len(ab)
ab = bytesutil.ResizeWithCopyMayOverallocate(ab, abLen+size)