AK: Pass (Deprecated)FlyString::is_one_of arguments by reference

This avoid unnecessairy reference counting.
This commit is contained in:
Jonne Ransijn 2024-10-27 00:37:14 +02:00 committed by Tim Flynn
parent 7f3269fb02
commit 22a66bb1c2
Notes: github-actions[bot] 2024-10-27 16:03:58 +00:00
2 changed files with 2 additions and 2 deletions

View file

@ -84,7 +84,7 @@ public:
static void did_destroy_impl(Badge<StringImpl>, StringImpl&); static void did_destroy_impl(Badge<StringImpl>, StringImpl&);
template<typename... Ts> 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))); return (... || this->operator==(forward<Ts>(strings)));
} }

View file

@ -74,7 +74,7 @@ public:
[[nodiscard]] bool ends_with_bytes(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive) const; [[nodiscard]] bool ends_with_bytes(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
template<typename... Ts> 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))); return (... || this->operator==(forward<Ts>(strings)));
} }