mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
AK: Pass (Deprecated)FlyString::is_one_of
arguments by reference
This avoid unnecessairy reference counting.
This commit is contained in:
parent
7f3269fb02
commit
22a66bb1c2
Notes:
github-actions[bot]
2024-10-27 16:03:58 +00:00
Author: https://github.com/yyny Commit: https://github.com/LadybirdBrowser/ladybird/commit/22a66bb1c2a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1987 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/trflynn89
2 changed files with 2 additions and 2 deletions
|
@ -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)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue