From da34a2b33e1f600ec11172f599384b9a92835403 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 19 May 2015 02:24:14 -0400 Subject: Replace instances of std::map with StringMap Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators --- src/content_mapnode.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/content_mapnode.cpp') diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 44d0b8e38..5e2a5c816 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mapnode.h" #include "nodedef.h" #include "nameidmapping.h" -#include +#include "util/string.h" /* Legacy node content type IDs @@ -218,14 +218,13 @@ public: } std::string get(const std::string &old) { - std::map::const_iterator i; - i = old_to_new.find(old); - if(i == old_to_new.end()) + StringMap::const_iterator it = old_to_new.find(old); + if (it == old_to_new.end()) return ""; - return i->second; + return it->second; } private: - std::map old_to_new; + StringMap old_to_new; }; NewNameGetter newnamegetter; -- cgit v1.2.3