mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:08:11 +00:00
AK: Add StringView operator==(char)
This commit is contained in:
parent
54be317fa9
commit
0396b6da82
1 changed files with 5 additions and 0 deletions
|
@ -227,6 +227,11 @@ public:
|
||||||
return *cp == '\0';
|
return *cp == '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool operator==(char const c) const
|
||||||
|
{
|
||||||
|
return m_length == 1 && *m_characters == c;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr bool operator!=(char const* cstring) const
|
constexpr bool operator!=(char const* cstring) const
|
||||||
{
|
{
|
||||||
return !(*this == cstring);
|
return !(*this == cstring);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue