summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-11 12:02:38 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-11 12:09:55 +0200
commit470c99a2a6ac793d60a044621681420aef91623b (patch)
tree2c45c48aac6e9da6a2488ed945ee7069c9793a65 /Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp
parent9b5696fee7012fc4ff75eed57ee6f77009dcb18c (diff)
downloadserenity-470c99a2a6ac793d60a044621681420aef91623b.zip
LibJS: Tweak the WeakContainer::remove_swept_cells() API a little bit
Make this API take a Span<Cell*> instead of a Vector<Cell*>&. This is behavior neutral, but stops the API looking like it wants to do mutable things to the Vector.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp
index 9e012043d6..01713fa39f 100644
--- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp
+++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp
@@ -42,10 +42,10 @@ bool FinalizationRegistry::remove_by_token(Object& unregister_token)
return removed;
}
-void FinalizationRegistry::remove_swept_cells(Badge<Heap>, Vector<Cell*>& cells)
+void FinalizationRegistry::remove_swept_cells(Badge<Heap>, Span<Cell*> cells)
{
auto any_cells_were_swept = false;
- for (auto cell : cells) {
+ for (auto* cell : cells) {
for (auto& record : m_records) {
if (record.target != cell)
continue;