diff --git a/Libraries/LibJS/Heap.cpp b/Libraries/LibJS/Heap.cpp index 035cf9dc3a..33ce668c54 100644 --- a/Libraries/LibJS/Heap.cpp +++ b/Libraries/LibJS/Heap.cpp @@ -118,15 +118,11 @@ void Heap::mark_live_cells(const HashTable& live_cells) #ifdef HEAP_DEBUG dbg() << "mark_live_cells:"; #endif - for (auto& block : m_blocks) { - block->for_each_cell([&](Cell* cell) { - if (live_cells.contains(cell)) { + for (auto& cell : live_cells) { #ifdef HEAP_DEBUG - dbg() << " ! " << cell; + dbg() << " ! " << cell; #endif - cell->set_marked(true); - } - }); + cell->set_marked(true); } }