mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +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:
parent
31de1b68bd
commit
165cf169e6
1 changed files with 10 additions and 2 deletions
|
@ -85,12 +85,20 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] TR_CONSTEXPR20 auto find(tr_quark const key) noexcept
|
[[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
|
[[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
|
[[nodiscard]] TR_CONSTEXPR20 auto size() const noexcept
|
||||||
|
|
Loading…
Add table
Reference in a new issue