зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1618542 - Add further uses of new transformation algorithms with nsTHashtable. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D70377
This commit is contained in:
Родитель
f3ac58690e
Коммит
1dd70d203d
|
@ -13772,18 +13772,15 @@ bool Database::InvalidateAll(const nsTHashtable<nsPtrHashKey<T>>& aTable) {
|
|||
return true;
|
||||
}
|
||||
|
||||
nsTArray<RefPtr<T>> elementsToInvalidate;
|
||||
if (NS_WARN_IF(!elementsToInvalidate.SetCapacity(count, fallible))) {
|
||||
const auto elementsToInvalidateOrErr = TransformIntoNewArray(
|
||||
aTable, [](const auto& entry) { return entry.GetKey(); }, fallible);
|
||||
if (elementsToInvalidateOrErr.isErr()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto iter = aTable.ConstIter(); !iter.Done(); iter.Next()) {
|
||||
elementsToInvalidate.AppendElement(iter.Get()->GetKey());
|
||||
}
|
||||
|
||||
IDB_REPORT_INTERNAL_ERR();
|
||||
|
||||
for (const auto& elementToInvalidate : elementsToInvalidate) {
|
||||
for (const auto& elementToInvalidate : elementsToInvalidateOrErr.inspect()) {
|
||||
MOZ_ASSERT(elementToInvalidate);
|
||||
|
||||
elementToInvalidate->Invalidate();
|
||||
|
|
Загрузка…
Ссылка в новой задаче