lib/prompbmarshal: use clear() instead of a loop for clearing tss inside ResetTimeSeries()

This commit is contained in:
Aliaksandr Valialkin 2024-03-03 23:40:34 +02:00
parent 4e65636b44
commit 614d34e539
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -26,8 +26,6 @@ func (wr *WriteRequest) Reset() {
// ResetTimeSeries clears all the GC references from tss and returns an empty tss ready for further use. // ResetTimeSeries clears all the GC references from tss and returns an empty tss ready for further use.
func ResetTimeSeries(tss []TimeSeries) []TimeSeries { func ResetTimeSeries(tss []TimeSeries) []TimeSeries {
for i := range tss { clear(tss)
tss[i] = TimeSeries{}
}
return tss[:0] return tss[:0]
} }