mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Make {String,FlyString}::is_one_of() const
Also, make the zero-argument variant private since it's not meant to be called by clients directly.
This commit is contained in:
parent
2b1517f215
commit
643464c455
Notes:
sideshowbarker
2024-07-19 05:58:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/643464c455c
2 changed files with 6 additions and 4 deletions
|
@ -89,9 +89,8 @@ public:
|
|||
|
||||
static void did_destroy_impl(Badge<StringImpl>, StringImpl&);
|
||||
|
||||
bool is_one_of() { return false; }
|
||||
template<typename T, typename... Rest>
|
||||
bool is_one_of(const T& string, Rest... rest)
|
||||
bool is_one_of(const T& string, Rest... rest) const
|
||||
{
|
||||
if (string == *this)
|
||||
return true;
|
||||
|
@ -100,6 +99,8 @@ public:
|
|||
|
||||
|
||||
private:
|
||||
bool is_one_of() const { return false; }
|
||||
|
||||
RefPtr<StringImpl> m_impl;
|
||||
};
|
||||
|
||||
|
|
|
@ -224,9 +224,8 @@ public:
|
|||
|
||||
int replace(const String& needle, const String& replacement, bool all_occurences = false);
|
||||
|
||||
bool is_one_of() { return false; }
|
||||
template<typename T, typename... Rest>
|
||||
bool is_one_of(const T& string, Rest... rest)
|
||||
bool is_one_of(const T& string, Rest... rest) const
|
||||
{
|
||||
if (string == *this)
|
||||
return true;
|
||||
|
@ -234,6 +233,8 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
bool is_one_of() const { return false; }
|
||||
|
||||
RefPtr<StringImpl> m_impl;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue