mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibELF: Add find_demangled_function
Also, added AK::String::index_of and fixed a bug in ELF::Loader::symbol_ptr
This commit is contained in:
parent
34f0d98e67
commit
e207de8449
Notes:
sideshowbarker
2024-07-19 07:37:18 +09:00
Author: https://github.com/itamar8910
Commit: e207de8449
Pull-request: https://github.com/SerenityOS/serenity/pull/1786
Reviewed-by: https://github.com/awesomekling
7 changed files with 71 additions and 24 deletions
|
@ -317,6 +317,18 @@ bool String::contains(const String& needle) const
|
|||
return strstr(characters(), needle.characters());
|
||||
}
|
||||
|
||||
Optional<size_t> String::index_of(const String& needle) const
|
||||
{
|
||||
if (is_null() || needle.is_null())
|
||||
return {};
|
||||
|
||||
const char* self_characters = characters();
|
||||
const char* result = strstr(self_characters, needle.characters());
|
||||
if (!result)
|
||||
return {};
|
||||
return Optional<size_t> { result - self_characters };
|
||||
}
|
||||
|
||||
bool String::equals_ignoring_case(const StringView& other) const
|
||||
{
|
||||
return StringUtils::equals_ignoring_case(view(), other);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue