1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-09 21:54:09 +00:00

refactor: extract the lambda method in tr_variant::Map::find() (#6161)

experimental change for msvc 19.37 ftbfs
This commit is contained in:
Charles Kerr 2023-10-25 15:36:28 -04:00 committed by GitHub
parent 31de1b68bd
commit 165cf169e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,12 +85,20 @@ public:
[[nodiscard]] TR_CONSTEXPR20 auto find(tr_quark const key) noexcept
{
return std::find_if(begin(), end(), [key](auto const& item) { return item.first == key; });
auto const predicate = [key](auto const& item)
{
return item.first == key;
};
return std::find_if(begin(), end(), predicate);
}
[[nodiscard]] TR_CONSTEXPR20 auto find(tr_quark const key) const noexcept
{
return std::find_if(begin(), end(), [key](auto const& item) { return item.first == key; });
auto const predicate = [key](auto const& item)
{
return item.first == key;
};
return std::find_if(cbegin(), cend(), predicate);
}
[[nodiscard]] TR_CONSTEXPR20 auto size() const noexcept