mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 20:07:38 +03:00
Improve WriteZeroN using clear
in go1.21
This commit is contained in:
parent
2a2dbf1971
commit
ad670bab68
1 changed files with 1 additions and 4 deletions
|
@ -216,10 +216,7 @@ func (b *Buffer) WriteZeroN(n int) error {
|
|||
if b.end+n > b.capacity {
|
||||
return io.ErrShortBuffer
|
||||
}
|
||||
for i := b.end; i < b.end+n; i++ {
|
||||
b.data[i] = 0
|
||||
}
|
||||
b.end += n
|
||||
common.ClearArray(b.Extend(n))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue