mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1381470 - Added a less memory consuming method to tell if a histogram is empty. r=chutten
This commit is contained in:
parent
3e9099fc0e
commit
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
|
||||
|
Loading…
Reference in New Issue
Block a user