Bug 1666487 - Constify some RollingMean getters. r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D95697
This commit is contained in:
Andreas Pehrson
2021-02-11 13:38:48 +00:00
parent 1581c45895
commit 42913a20dd

View File

@@ -69,12 +69,12 @@ class RollingMean {
/** /**
* Calculate the rolling mean. * Calculate the rolling mean.
*/ */
T mean() { T mean() const {
MOZ_ASSERT(!empty()); MOZ_ASSERT(!empty());
return T(mTotal / int64_t(mValues.length())); return T(mTotal / int64_t(mValues.length()));
} }
bool empty() { return mValues.empty(); } bool empty() const { return mValues.empty(); }
/** /**
* Remove all values from the rolling mean. * Remove all values from the rolling mean.
@@ -85,7 +85,7 @@ class RollingMean {
mTotal = T(0); mTotal = T(0);
} }
size_t maxValues() { return mMaxValues; } size_t maxValues() const { return mMaxValues; }
}; };
} // namespace mozilla } // namespace mozilla