From 1be7403820c92d355d3115fc177e732b6e3b9cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20H=C3=A4rer?= Date: Sun, 7 Jul 2024 21:42:20 +0200 Subject: Map: Simplify constructor --- xbmc/utils/Map.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/xbmc/utils/Map.h b/xbmc/utils/Map.h index f4a1c872c4..21c4011621 100644 --- a/xbmc/utils/Map.h +++ b/xbmc/utils/Map.h @@ -36,26 +36,7 @@ public: template constexpr CMap(Iterable begin, Iterable end) { - size_t index = 0; - while (begin != end) - { - // c++17 doesn't have constexpr assignment operator for std::pair - auto& first = m_map[index].first; - auto& second = m_map[index].second; - ++index; - - first = std::move(begin->first); - second = std::move(begin->second); - ++begin; - - //! @todo: c++20 can use constexpr assignment operator instead - // auto& p = data[index]; - // ++index; - - // p = std::move(*begin); - // ++begin; - // - } + std::move(begin, end, m_map.begin()); if constexpr (requires(Key k) { std::less<>{}(k, k); }) { -- cgit v1.2.3