]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/content_mapnode.cpp
src/environment.cpp: Fix NULL pointer dereference
[dragonfireclient.git] / src / content_mapnode.cpp
index 44d0b8e386685f72ec3000a4fcce5120608b32f1..5e2a5c816e3361838153a43ca417dd5cc09310c2 100644 (file)
@@ -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 @@ class NewNameGetter
        }
        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;