зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1381470 - Added a less memory consuming method to tell if a histogram is empty. r=chutten
This commit is contained in:
Родитель
3e9099fc0e
Коммит
deef8d264a
|
@ -115,6 +115,10 @@ class Histogram {
|
|||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
bool is_empty() const {
|
||||
return this->sample_.counts(0) == 0 && this->sample_.sum() == 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Statistic values, developed over the life of the histogram.
|
||||
|
||||
|
|
|
@ -335,9 +335,7 @@ internal_CanRecordExtended() {
|
|||
bool
|
||||
internal_IsEmpty(const Histogram *h)
|
||||
{
|
||||
Histogram::SampleSet ss;
|
||||
h->SnapshotSample(&ss);
|
||||
return ss.counts(0) == 0 && ss.sum() == 0;
|
||||
return h->is_empty();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче