зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1388748 - Don't resize histogram ranges on init r=gfritzsche
We were using std::vector::assign, which resizes the vector to match the incoming data. This isn't what we want, as ranges_ has already been sized to bucket_count_ + 1. Instead, just use a copy. MozReview-Commit-ID: EGuW5jj7Rpq --HG-- extra : rebase_source : 616d61fc27c7e43c22ea69e11e070ba958bf20a9
This commit is contained in:
Родитель
3c7cc8f012
Коммит
a70aac6a11
|
@ -273,7 +273,8 @@ Histogram::~Histogram() {
|
|||
}
|
||||
|
||||
void Histogram::InitializeBucketRangeFromData(const int* buckets) {
|
||||
ranges_.assign(buckets, buckets + bucket_count());
|
||||
DCHECK_EQ(bucket_count_ + 1, ranges_.size());
|
||||
std::copy_n(buckets, bucket_count_, ranges_.data());
|
||||
ResetRangeChecksum();
|
||||
DCHECK(ValidateBucketRanges());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче