From fdb27c585165a5092a10338dfbf8e17501e88c99 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Tue, 22 Aug 2023 19:23:32 +0200 Subject: [PATCH] LibWeb: Use StringView in calls to Vector::contains_slow() --- Userland/Libraries/LibWeb/Fetch/Fetching/Checks.cpp | 2 +- .../LibWeb/HTML/CustomElements/CustomElementRegistry.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/Checks.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/Checks.cpp index 79bacb998a..fdfdb73733 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/Checks.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/Checks.cpp @@ -56,7 +56,7 @@ ErrorOr tao_check(Infrastructure::Request const& request, Infrastructure:: auto values = TRY(response.header_list()->get_decode_and_split("Timing-Allow-Origin"sv.bytes())); // 3. If values contains "*", then return success. - if (values.has_value() && values->contains_slow("*"_string)) + if (values.has_value() && values->contains_slow("*"sv)) return true; // 4. If values contains the result of serializing a request origin with request, then return success. diff --git a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp index 7eb760988d..2820df4f3f 100644 --- a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp +++ b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp @@ -224,10 +224,10 @@ JS::ThrowCompletionOr CustomElementRegistry::define(String const& name, We disabled_features = TRY(convert_value_to_sequence_of_strings(vm, disabled_features_iterable)); // 9. Set disableInternals to true if disabledFeatures contains "internals". - disable_internals = disabled_features.contains_slow("internals"_string); + disable_internals = disabled_features.contains_slow("internals"sv); // 10. Set disableShadow to true if disabledFeatures contains "shadow". - disable_shadow = disabled_features.contains_slow("shadow"_string); + disable_shadow = disabled_features.contains_slow("shadow"sv); // 11. Let formAssociatedValue be ? Get( constructor, "formAssociated"). auto form_associated_value = TRY(constructor->callback->get(JS::PropertyKey { "formAssociated" }));