mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 22:22:55 +00:00
AK: Add String::find_last() and inline String::find() methods
This adds the String::find_last() as wrapper for StringUtils::find_last, which is another step in harmonizing the String and StringView APIs where possible. This also inlines the find() methods, as they are simple wrappers around StringUtils functions without any additional logic.
This commit is contained in:
parent
d7a104c27c
commit
268d81a56c
Notes:
sideshowbarker
2024-07-18 11:06:10 +09:00
Author: https://github.com/MaxWipfli
Commit: 268d81a56c
Pull-request: https://github.com/SerenityOS/serenity/pull/8368
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/trflynn89
2 changed files with 4 additions and 12 deletions
|
@ -459,14 +459,4 @@ String String::vformatted(StringView fmtstr, TypeErasedFormatParams params)
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
Optional<size_t> String::find(char c, size_t start) const
|
||||
{
|
||||
return find(StringView { &c, 1 }, start);
|
||||
}
|
||||
|
||||
Optional<size_t> String::find(StringView const& view, size_t start) const
|
||||
{
|
||||
return StringUtils::find(*this, view, start);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue