mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:27:35 +00:00
AK: Add some string comparison operators
Some of these are very inefficient. It's nice to have some optimization opportunities in the future though. :^)
This commit is contained in:
parent
0d2fb306af
commit
95cc4c7e74
4 changed files with 34 additions and 0 deletions
|
@ -50,6 +50,11 @@ String::String(const StringView& view)
|
|||
m_impl = StringImpl::create(view.characters_without_null_termination(), view.length());
|
||||
}
|
||||
|
||||
bool String::operator==(const FlyString& fly_string) const
|
||||
{
|
||||
return *this == String(fly_string.impl());
|
||||
}
|
||||
|
||||
bool String::operator==(const String& other) const
|
||||
{
|
||||
if (!m_impl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue