diff --git a/AK/LexicalPath.cpp b/AK/LexicalPath.cpp index 2e1035396b9..3e3e92b7462 100644 --- a/AK/LexicalPath.cpp +++ b/AK/LexicalPath.cpp @@ -93,7 +93,7 @@ void LexicalPath::canonicalize() m_string = builder.to_string(); } -bool LexicalPath::has_extension(const StringView& extension) const +bool LexicalPath::has_extension(StringView const& extension) const { return m_string.ends_with(extension, CaseSensitivity::CaseInsensitive); } @@ -103,7 +103,7 @@ String LexicalPath::canonicalized_path(String path) return LexicalPath(move(path)).string(); } -String LexicalPath::relative_path(String absolute_path, const String& prefix) +String LexicalPath::relative_path(String absolute_path, String const& prefix) { if (!LexicalPath { absolute_path }.is_absolute() || !LexicalPath { prefix }.is_absolute()) return {}; diff --git a/AK/LexicalPath.h b/AK/LexicalPath.h index e5c3b2d7333..7e2b2b7c133 100644 --- a/AK/LexicalPath.h +++ b/AK/LexicalPath.h @@ -18,16 +18,16 @@ public: bool is_valid() const { return m_is_valid; } bool is_absolute() const { return m_is_absolute; } - const String& string() const { return m_string; } + String const& string() const { return m_string; } - const String& dirname() const { return m_dirname; } - const String& basename() const { return m_basename; } - const String& title() const { return m_title; } - const String& extension() const { return m_extension; } + String const& dirname() const { return m_dirname; } + String const& basename() const { return m_basename; } + String const& title() const { return m_title; } + String const& extension() const { return m_extension; } - const Vector& parts() const { return m_parts; } + Vector const& parts() const { return m_parts; } - bool has_extension(const StringView&) const; + bool has_extension(StringView const&) const; void append(String const& component); @@ -59,7 +59,7 @@ private: template<> struct Formatter : Formatter { - void format(FormatBuilder& builder, const LexicalPath& value) + void format(FormatBuilder& builder, LexicalPath const& value) { Formatter::format(builder, value.string()); }