use clear()

This commit is contained in:
JackDoan
2026-05-06 15:46:17 -05:00
parent fe93ebd017
commit cf51b6dfd7
4 changed files with 8 additions and 24 deletions

View File

@@ -55,9 +55,7 @@ func (b *SendBatch) Flush() error {
if len(b.bufs) > 0 {
err = b.out.WriteBatch(b.bufs, b.dsts, b.ecns)
}
for i := range b.bufs {
b.bufs[i] = nil
}
clear(b.bufs)
b.bufs = b.bufs[:0]
b.dsts = b.dsts[:0]
b.ecns = b.ecns[:0]