mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
AK+Everywhere: Remove StringView::find_{first,last}_of(char) methods
This removes StringView::find_first_of(char) and find_last_of(char) and replaces all its usages with find and find_last respectively. This is because those two methods are functionally equivalent. find_{first,last}_of should only be used if searching for multiple different characters, which is never the case with the char argument. This also adds the [[nodiscard]] to the remaining find_{first,last}_of methods.
This commit is contained in:
parent
56253bf389
commit
3bdaed501e
Notes:
sideshowbarker
2024-07-18 11:06:17 +09:00
Author: https://github.com/MaxWipfli
Commit: 3bdaed501e
Pull-request: https://github.com/SerenityOS/serenity/pull/8368
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/trflynn89
10 changed files with 41 additions and 68 deletions
|
@ -163,7 +163,7 @@ int main(int argc, char** argv)
|
|||
.value_name = "header-value",
|
||||
.accept_value = [&](auto* s) {
|
||||
StringView header { s };
|
||||
auto split = header.find_first_of(':');
|
||||
auto split = header.find(':');
|
||||
if (!split.has_value())
|
||||
return false;
|
||||
request_headers.set(header.substring_view(0, split.value()), header.substring_view(split.value() + 1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue