diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2022-07-11 20:19:57 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-12 23:11:35 +0200 |
commit | 5422691f0769221ea41627287997f6cc113c4528 (patch) | |
tree | bc40f9239d12ccdd88a4811a287fe15fcbaf579b /Userland/Libraries/LibRegex | |
parent | 87f5e0bcda03889f15904f8560b85c3f30f7873f (diff) | |
download | serenity-5422691f0769221ea41627287997f6cc113c4528.zip |
LibRegex: Remove RegexStringView(char const*) constructor
This allowed passing in a nullptr for the StringView which will not be
possible once StringView(char const*) is removed.
Diffstat (limited to 'Userland/Libraries/LibRegex')
-rw-r--r-- | Userland/Libraries/LibRegex/RegexMatch.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h index 7359fcf785..a15cabb744 100644 --- a/Userland/Libraries/LibRegex/RegexMatch.h +++ b/Userland/Libraries/LibRegex/RegexMatch.h @@ -25,10 +25,7 @@ namespace regex { class RegexStringView { public: - RegexStringView(char const* chars) - : m_view(StringView { chars }) - { - } + RegexStringView() = default; RegexStringView(String const& string) : m_view(string.view()) @@ -448,7 +445,7 @@ public: } private: - Variant<StringView, Utf8View, Utf16View, Utf32View> m_view; + Variant<StringView, Utf8View, Utf16View, Utf32View> m_view { StringView {} }; bool m_unicode { false }; }; @@ -498,7 +495,7 @@ public: left_column = 0; } - RegexStringView view { nullptr }; + RegexStringView view {}; Optional<FlyString> capture_group_name {}; size_t line { 0 }; size_t column { 0 }; @@ -510,7 +507,7 @@ public: }; struct MatchInput { - RegexStringView view { nullptr }; + RegexStringView view {}; AllOptions regex_options {}; size_t start_offset { 0 }; // For Stateful matches, saved and restored from Regex::start_offset. |