mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add StringView operator==(char)
This commit is contained in:
parent
54be317fa9
commit
0396b6da82
Notes:
sideshowbarker
2024-07-17 06:34:59 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/0396b6da82 Pull-request: https://github.com/SerenityOS/serenity/pull/14296 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bgianfo
1 changed files with 5 additions and 0 deletions
|
@ -227,6 +227,11 @@ public:
|
|||
return *cp == '\0';
|
||||
}
|
||||
|
||||
constexpr bool operator==(char const c) const
|
||||
{
|
||||
return m_length == 1 && *m_characters == c;
|
||||
}
|
||||
|
||||
constexpr bool operator!=(char const* cstring) const
|
||||
{
|
||||
return !(*this == cstring);
|
||||
|
|
Loading…
Reference in a new issue