Add a reserve in sampler.cc.

PiperOrigin-RevId: 824620123
This commit is contained in:
A. Unique TensorFlower 2025-10-27 12:05:43 -07:00 committed by TensorFlower Gardener
parent 6d8ae3a9d7
commit 428f0df91b

View File

@ -82,6 +82,7 @@ class ExponentialBuckets : public Buckets {
int bucket_count) { int bucket_count) {
CHECK_GT(bucket_count, 0); CHECK_GT(bucket_count, 0);
std::vector<double> bucket_limits; std::vector<double> bucket_limits;
bucket_limits.reserve(bucket_count);
double bound = scale; double bound = scale;
for (int i = 0; i < bucket_count; i++) { for (int i = 0; i < bucket_count; i++) {
bucket_limits.push_back(bound); bucket_limits.push_back(bound);