mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 05:35:52 +03:00
AK: Omit unnecessary function parameter names in URL
This patch removes unnecessary function parameter names in declarations of the URL class. It also changes parameter types from String to StringView where applicable.
This commit is contained in:
parent
d105747735
commit
d6709ac87d
Notes:
sideshowbarker
2024-07-18 17:05:01 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/d6709ac87d7 Pull-request: https://github.com/SerenityOS/serenity/pull/7478 Reviewed-by: https://github.com/awesomekling
@ -349,7 +349,7 @@ void URL::set_host(const String& host)
|
||||
m_valid = compute_validity();
|
||||
}
|
||||
|
||||
void URL::set_port(u16 port)
|
||||
void URL::set_port(const u16 port)
|
||||
{
|
||||
m_port = port;
|
||||
m_valid = compute_validity();
|
||||
@ -404,12 +404,12 @@ bool URL::compute_validity() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool URL::protocol_requires_port(const String& protocol)
|
||||
bool URL::protocol_requires_port(const StringView& protocol)
|
||||
{
|
||||
return (default_port_for_protocol(protocol) != 0);
|
||||
}
|
||||
|
||||
u16 URL::default_port_for_protocol(const String& protocol)
|
||||
u16 URL::default_port_for_protocol(const StringView& protocol)
|
||||
{
|
||||
if (protocol == "http")
|
||||
return 80;
|
||||
|
18
AK/URL.h
18
AK/URL.h
@ -35,12 +35,12 @@ public:
|
||||
String fragment() const { return m_fragment; }
|
||||
u16 port() const { return m_port; }
|
||||
|
||||
void set_protocol(const String& protocol);
|
||||
void set_host(const String& host);
|
||||
void set_port(const u16 port);
|
||||
void set_path(const String& path);
|
||||
void set_query(const String& query);
|
||||
void set_fragment(const String& fragment);
|
||||
void set_protocol(const String&);
|
||||
void set_host(const String&);
|
||||
void set_port(const u16);
|
||||
void set_path(const String&);
|
||||
void set_query(const String&);
|
||||
void set_fragment(const String&);
|
||||
|
||||
String basename() const;
|
||||
String to_string() const;
|
||||
@ -56,11 +56,11 @@ public:
|
||||
const String& data_mime_type() const { return m_data_mime_type; }
|
||||
const String& data_payload() const { return m_data_payload; }
|
||||
|
||||
static URL create_with_url_or_path(const String& url_or_path);
|
||||
static URL create_with_url_or_path(const String&);
|
||||
static URL create_with_file_protocol(const String& path, const String& fragment = {});
|
||||
static URL create_with_data(const StringView& mime_type, const StringView& payload, bool is_base64 = false);
|
||||
static bool protocol_requires_port(const String& protocol);
|
||||
static u16 default_port_for_protocol(const String& protocol);
|
||||
static bool protocol_requires_port(const StringView&);
|
||||
static u16 default_port_for_protocol(const StringView&);
|
||||
|
||||
bool operator==(const URL& other) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user