From 83e26f839d28c5d9aa75aeab7d924fcaad445007 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 5 Apr 2021 13:38:31 +0200 Subject: Reserve vectors before pushing and other code quality changes (#11161) --- src/nodedef.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nodedef.cpp') diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 57d4c008f..a3b6b18c1 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -1543,10 +1543,10 @@ void NodeDefManager::deSerialize(std::istream &is) } -void NodeDefManager::addNameIdMapping(content_t i, std::string name) +void NodeDefManager::addNameIdMapping(content_t i, const std::string &name) { m_name_id_mapping.set(i, name); - m_name_id_mapping_with_aliases.insert(std::make_pair(name, i)); + m_name_id_mapping_with_aliases.emplace(name, i); } -- cgit v1.2.3