mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:27:34 +00:00
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.
This commit is contained in:
parent
721a4a0a67
commit
5e5b94a7ec
2 changed files with 2 additions and 2 deletions
|
@ -1006,7 +1006,7 @@ String Document::cookie(Cookie::Source source)
|
||||||
return {};
|
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);
|
auto cookie = Cookie::parse_cookie(cookie_string);
|
||||||
if (!cookie.has_value())
|
if (!cookie.has_value())
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
virtual ~Document() override;
|
virtual ~Document() override;
|
||||||
|
|
||||||
String cookie(Cookie::Source = Cookie::Source::NonHttp);
|
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;
|
String referrer() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue