From 79240eab1ee4abb2882a40c7ac18e4915b4dc820 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Tue, 15 Dec 2020 00:22:04 +0100 Subject: Codechange: Make use of the improved C++17 emplace_back function. --- src/core/smallmap_type.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 931a4848b..744f9fd26 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -142,8 +142,7 @@ struct SmallMap : std::vector > { for (uint i = 0; i < std::vector::size(); i++) { if (key == std::vector::operator[](i).first) return std::vector::operator[](i).second; } - /*C++17: Pair &n = */ std::vector::emplace_back(); - Pair &n = std::vector::back(); + Pair &n = std::vector::emplace_back(); n.first = key; return n.second; } -- cgit v1.2.3-70-g09d2