Bug 1009263 - Add nsCheapSets::Clear() method that removes all entries and return it to minimal size in terms of memory use. r=bsmedberg

This commit is contained in:
Mats Palmgren 2014-05-17 23:10:53 +00:00
Родитель 24ea7f9b72
Коммит 257e69aae5
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -24,6 +24,14 @@ public:
{
}
~nsCheapSet()
{
Clear();
}
/**
* Remove all entries.
*/
void Clear()
{
switch (mState) {
case ZERO:
@ -38,6 +46,7 @@ public:
NS_NOTREACHED("bogus state");
break;
}
mState = ZERO;
}
nsresult Put(const KeyType aVal);