mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
String: Define operator>(String)
This commit is contained in:
parent
fbdd0def47
commit
96f9e6a64f
Notes:
sideshowbarker
2024-07-19 11:37:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/96f9e6a64fd
1 changed files with 11 additions and 0 deletions
|
@ -44,6 +44,17 @@ bool String::operator<(const String& other) const
|
|||
return strcmp(characters(), other.characters()) < 0;
|
||||
}
|
||||
|
||||
bool String::operator>(const String& other) const
|
||||
{
|
||||
if (!m_impl)
|
||||
return other.m_impl;
|
||||
|
||||
if (!other.m_impl)
|
||||
return false;
|
||||
|
||||
return strcmp(characters(), other.characters()) > 0;
|
||||
}
|
||||
|
||||
String String::empty()
|
||||
{
|
||||
return StringImpl::the_empty_stringimpl();
|
||||
|
|
Loading…
Reference in a new issue