Use unordered_map instead of map for craft definitions (#8432)
authorHybridDog <ovvv@web.de>
Sun, 31 Mar 2019 17:26:17 +0000 (19:26 +0200)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Sun, 31 Mar 2019 17:26:17 +0000 (19:26 +0200)
src/craftdef.cpp

index 077d7e0443b397eebf26d4015671eb28d7b6bcd5..04e418e29436d6bf734d255a7b8974f05f63c718 100644 (file)
@@ -922,7 +922,7 @@ public:
 
                                        // Get output, then decrement input (if requested)
                                        output = out;
-                    
+
                                        if (decrementInput)
                                                def->decrementInput(input, output_replacement, gamedef);
                                        /*errorstream << "Check RETURNS TRUE" << std::endl;*/
@@ -1099,9 +1099,10 @@ public:
                unhashed.clear();
        }
 private:
-       //TODO: change both maps to unordered_map when c++11 can be used
-       std::vector<std::map<u64, std::vector<CraftDefinition*> > > m_craft_defs;
-       std::map<std::string, std::vector<CraftDefinition*> > m_output_craft_definitions;
+       std::vector<std::unordered_map<u64, std::vector<CraftDefinition*> > >
+               m_craft_defs;
+       std::unordered_map<std::string, std::vector<CraftDefinition*> >
+               m_output_craft_definitions;
 };
 
 IWritableCraftDefManager* createCraftDefManager()