diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-02-12 15:45:39 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-02-12 16:15:56 +0000 |
commit | 5e5b94a7ecd05608babaff48ffef0ece99132512 (patch) | |
tree | 8bdd2d3a399bcc1f941206dff8aa5c21d776fa14 /Userland/Libraries | |
parent | 721a4a0a67bb821de3e4a1e878fb08b087274f12 (diff) | |
download | serenity-5e5b94a7ecd05608babaff48ffef0ece99132512.zip |
LibWeb: Pass cookie string by reference in Document::set_cookie
This string is only taken by const reference internally, so there's no
point in forcing the callers to copy the string.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index a0ef87151f..0369b42a3c 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1006,7 +1006,7 @@ String Document::cookie(Cookie::Source source) return {}; } -void Document::set_cookie(String cookie_string, Cookie::Source source) +void Document::set_cookie(String const& cookie_string, Cookie::Source source) { auto cookie = Cookie::parse_cookie(cookie_string); if (!cookie.has_value()) diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 1b67116601..529a236e8f 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -56,7 +56,7 @@ public: virtual ~Document() override; String cookie(Cookie::Source = Cookie::Source::NonHttp); - void set_cookie(String, Cookie::Source = Cookie::Source::NonHttp); + void set_cookie(String const&, Cookie::Source = Cookie::Source::NonHttp); String referrer() const; |