summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/URL/URLSearchParams.cpp')
-rw-r--r--Userland/Libraries/LibWeb/URL/URLSearchParams.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
index 3ff4368c89..82a556c09d 100644
--- a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
+++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp
@@ -195,4 +195,13 @@ String URLSearchParams::to_string()
return url_encode(m_list, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded);
}
+void URLSearchParams::for_each(Function<IterationDecision(String const&, String const&)> callback)
+{
+ for (auto i = 0u; i < m_list.size(); ++i) {
+ auto& query_param = m_list[i]; // We are explicitly iterating over the indices here as the callback might delete items from the list
+ if (callback(query_param.name, query_param.value) == IterationDecision::Break)
+ break;
+ }
+}
+
}