mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
AK: Pass (Deprecated)FlyString::is_one_of arguments by reference
This avoid unnecessairy reference counting. (cherry picked from commit 22a66bb1c2afde93096d9866d6386e2bca955f71)
This commit is contained in:
1 parent
c591562b0d
commit
9614721bde
2 files changed
+2
-2
No files matched your search
@@ -84,7 +84,7 @@ public:
|
||||
static void did_destroy_impl(Badge<StringImpl>, StringImpl&);
|
||||
|
||||
template<typename... Ts>
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts... strings) const
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts&&... strings) const
|
||||
{
|
||||
return (... || this->operator==(forward<Ts>(strings)));
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public:
|
||||
[[nodiscard]] bool ends_with_bytes(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
||||
|
||||
template<typename... Ts>
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts... strings) const
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr bool is_one_of(Ts&&... strings) const
|
||||
{
|
||||
return (... || this->operator==(forward<Ts>(strings)));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user