summaryrefslogtreecommitdiff
path: root/src/content_mapnode.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-05-19 02:24:14 -0400
committerkwolekr <kwolekr@minetest.net>2015-05-19 16:10:49 -0400
commitda34a2b33e1f600ec11172f599384b9a92835403 (patch)
treef09a158be783f0486447d0c61750a7509760d83b /src/content_mapnode.cpp
parent603297cc352cab685dd01dcd645999624ad17c0b (diff)
downloadminetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.gz
minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.bz2
minetest-da34a2b33e1f600ec11172f599384b9a92835403.zip
Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators
Diffstat (limited to 'src/content_mapnode.cpp')
-rw-r--r--src/content_mapnode.cpp11
1 files changed, 5 insertions, 6 deletions
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 <map>
+#include "util/string.h"
/*
Legacy node content type IDs
@@ -218,14 +218,13 @@ public:
}
std::string get(const std::string &old)
{
- std::map<std::string, std::string>::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<std::string, std::string> old_to_new;
+ StringMap old_to_new;
};
NewNameGetter newnamegetter;