diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-12-15 00:22:04 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-12-15 00:29:30 +0100 |
commit | 79240eab1ee4abb2882a40c7ac18e4915b4dc820 (patch) | |
tree | 98abb3c8ccf490efa459ed29fe7f28699c8d9928 /src/core | |
parent | cc1679e3171bf6982164c4072a773fdd687ea885 (diff) | |
download | openttd-79240eab1ee4abb2882a40c7ac18e4915b4dc820.tar.xz |
Codechange: Make use of the improved C++17 emplace_back function.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/smallmap_type.hpp | 3 |
1 files changed, 1 insertions, 2 deletions
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<std::pair<T, U> > { for (uint i = 0; i < std::vector<Pair>::size(); i++) { if (key == std::vector<Pair>::operator[](i).first) return std::vector<Pair>::operator[](i).second; } - /*C++17: Pair &n = */ std::vector<Pair>::emplace_back(); - Pair &n = std::vector<Pair>::back(); + Pair &n = std::vector<Pair>::emplace_back(); n.first = key; return n.second; } |