This commit is contained in:
Aliaksandr Valialkin 2024-05-06 23:09:39 +02:00
parent adcdb92b1e
commit 9f33220e51
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -317,9 +317,12 @@ func (shard *pipeSortProcessorShard) createTimestampsIfNeeded(timestamps []int64
return nil
}
timestampsBuf := shard.timestampsBuf
timestampsBufLen := len(shard.timestampsBuf)
shard.timestampsBuf = append(shard.timestampsBuf, timestamps...)
shard.stateSizeBudget -= (len(timestamps) - timestampsBufLen) * int(unsafe.Sizeof(timestamps[0]))
timestampsBuf = append(timestampsBuf, timestamps...)
shard.timestampsBuf = timestampsBuf
shard.stateSizeBudget -= (len(timestampsBuf) - timestampsBufLen) * int(unsafe.Sizeof(timestampsBuf[0]))
return shard.timestampsBuf[timestampsBufLen:]
}