зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1407143 (Part 2) - Refactor sweepEntry() for readability r=sfink
--HG-- extra : rebase_source : 9af47c96c3bfe35d6610244d5b45f4b102865078
This commit is contained in:
Родитель
4318fee24e
Коммит
c536a48bdf
|
@ -1578,10 +1578,15 @@ InnerViewTable::sweepEntry(JSObject** pkey, ViewVector& views)
|
|||
return true;
|
||||
|
||||
MOZ_ASSERT(!views.empty());
|
||||
for (size_t i = 0; i < views.length(); i++) {
|
||||
size_t i = 0;
|
||||
while (i < views.length()) {
|
||||
if (IsAboutToBeFinalizedUnbarriered(&views[i])) {
|
||||
views[i--] = views.back();
|
||||
// If the current element is garbage then remove it from the
|
||||
// vector by moving the last one into its place.
|
||||
views[i] = views.back();
|
||||
views.popBack();
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче