diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-24 11:50:46 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-24 11:59:18 +0200 |
commit | de395a3df236eb653db78b5b88a0178036f99ba0 (patch) | |
tree | 2a6bd2f6126aa62650fc92092eaa4d88ebebc19e /Userland/Libraries/LibWeb/CSS | |
parent | 875a2cbb7150b036af343364a8bf2d07a97dd03d (diff) | |
download | serenity-de395a3df236eb653db78b5b88a0178036f99ba0.zip |
AK+Everywhere: Consolidate String::index_of() and String::find()
We had two functions for doing mostly the same thing. Combine both
of them into String::find() and use that everywhere.
Also add some tests to cover basic behavior.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp index c0c57a79eb..94ee9dbaaf 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp @@ -389,7 +389,7 @@ public: { if (const auto start_pos = pseudo_name.find('('); start_pos.has_value()) { const auto start = start_pos.value() + 1; - if (const auto end_pos = pseudo_name.index_of(")", start); end_pos.has_value()) { + if (const auto end_pos = pseudo_name.find(')', start); end_pos.has_value()) { return pseudo_name.substring_view(start, end_pos.value() - start).trim_whitespace(); } } |