mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
Bug 1186811 (part 4) - Replace nsBaseHashtable::EnumerateRead() calls in dom/storage/ with iterators. r=baku.
--HG-- extra : rebase_source : a6698e724537b4bb26abc13a2f9b85eda20893fb
This commit is contained in:
parent
de12cd37e8
commit
4ea95b701d
@ -378,19 +378,6 @@ DOMStorageCache::GetKey(const DOMStorage* aStorage, uint32_t aIndex, nsAString&
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
static PLDHashOperator
|
||||
KeysArrayBuilder(const nsAString& aKey, const nsString aValue, void* aArg)
|
||||
{
|
||||
nsTArray<nsString>* keys = static_cast<nsTArray<nsString>* >(aArg);
|
||||
|
||||
keys->AppendElement(aKey);
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void
|
||||
DOMStorageCache::GetKeys(const DOMStorage* aStorage, nsTArray<nsString>& aKeys)
|
||||
{
|
||||
@ -402,7 +389,9 @@ DOMStorageCache::GetKeys(const DOMStorage* aStorage, nsTArray<nsString>& aKeys)
|
||||
return;
|
||||
}
|
||||
|
||||
DataSet(aStorage).mKeys.EnumerateRead(KeysArrayBuilder, &aKeys);
|
||||
for (auto iter = DataSet(aStorage).mKeys.Iter(); !iter.Done(); iter.Next()) {
|
||||
aKeys.AppendElement(iter.Key());
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
Loading…
x
Reference in New Issue
Block a user