mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1614610 - Fix missing initialization of CacheIndexStats::mCountByType[] and CacheIndexStats::mSizeByType[] r=valentin
Initialization was missing in CacheIndexStats::CacheIndexStats() and CacheIndexStats::Clear(). Comparison was also added to CacheIndexStats::operator==(). Differential Revision: https://phabricator.services.mozilla.com/D64406 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
cb9e7bf077
commit
f913f3c0b6
@ -482,9 +482,20 @@ class CacheIndexStats {
|
||||
mDisableLogging(false)
|
||||
#endif
|
||||
{
|
||||
for (uint32_t i = 0; i < nsICacheEntry::CONTENT_TYPE_LAST; ++i) {
|
||||
mCountByType[i] = 0;
|
||||
mSizeByType[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator==(const CacheIndexStats& aOther) const {
|
||||
for (uint32_t i = 0; i < nsICacheEntry::CONTENT_TYPE_LAST; ++i) {
|
||||
if (mCountByType[i] != aOther.mCountByType[i] ||
|
||||
mSizeByType[i] != aOther.mSizeByType[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
#ifdef DEBUG
|
||||
aOther.mStateLogged == mStateLogged &&
|
||||
@ -516,6 +527,10 @@ class CacheIndexStats {
|
||||
mFresh = 0;
|
||||
mEmpty = 0;
|
||||
mSize = 0;
|
||||
for (uint32_t i = 0; i < nsICacheEntry::CONTENT_TYPE_LAST; ++i) {
|
||||
mCountByType[i] = 0;
|
||||
mSizeByType[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user