From 8b1108e4858f797c9216dc8ae4a3918ad50c73b4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 11 Nov 2021 00:55:02 +0100 Subject: Everywhere: Pass AK::StringView by value --- Userland/Libraries/LibRegex/RegexMatch.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Userland/Libraries/LibRegex/RegexMatch.h') diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h index 6d707650ee..2ebd0f5f8c 100644 --- a/Userland/Libraries/LibRegex/RegexMatch.h +++ b/Userland/Libraries/LibRegex/RegexMatch.h @@ -57,7 +57,7 @@ public: explicit RegexStringView(String&&) = delete; - StringView const& string_view() const + StringView string_view() const { return m_view.get(); } @@ -280,7 +280,7 @@ public: size_t code_unit_offset_of(size_t code_point_index) const { return m_view.visit( - [&](StringView const& view) -> u32 { + [&](StringView view) -> u32 { Utf8View utf8_view { view }; return utf8_view.byte_offset_of(code_point_index); }, @@ -316,7 +316,7 @@ public: [&](StringView view) { return view == string; }); } - bool operator==(StringView const& string) const + bool operator==(StringView string) const { return m_view.visit( [&](Utf32View) { return to_string() == string; }, @@ -325,7 +325,7 @@ public: [&](StringView view) { return view == string; }); } - bool operator!=(StringView const& other) const + bool operator!=(StringView other) const { return !(*this == other); } @@ -374,12 +374,12 @@ public: return !(*this == other); } - bool equals(RegexStringView const& other) const + bool equals(RegexStringView other) const { return other.m_view.visit([&](auto const& view) { return operator==(view); }); } - bool equals_ignoring_case(RegexStringView const& other) const + bool equals_ignoring_case(RegexStringView other) const { // FIXME: Implement equals_ignoring_case() for unicode. return m_view.visit( @@ -396,7 +396,7 @@ public: [](auto&) -> bool { TODO(); }); } - bool starts_with(StringView const& str) const + bool starts_with(StringView str) const { return m_view.visit( [&](Utf32View) -> bool { @@ -536,7 +536,7 @@ using regex::RegexStringView; template<> struct AK::Formatter : Formatter { - void format(FormatBuilder& builder, regex::RegexStringView const& value) + void format(FormatBuilder& builder, regex::RegexStringView value) { auto string = value.to_string(); return Formatter::format(builder, string); -- cgit v1.2.3