diff options
author | HybridDog <ovvv@web.de> | 2019-03-31 19:26:17 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2019-03-31 19:26:17 +0200 |
commit | ab322fc5aa0b81375aa1d5b2e9b0a0872eecb26f (patch) | |
tree | 2cf9376c69fe57387489c3001f9d1ba16cf4e081 /src/craftdef.cpp | |
parent | ad75dba87bb39de2c3d12b228bf113abe740c942 (diff) | |
download | minetest-ab322fc5aa0b81375aa1d5b2e9b0a0872eecb26f.tar.gz minetest-ab322fc5aa0b81375aa1d5b2e9b0a0872eecb26f.tar.bz2 minetest-ab322fc5aa0b81375aa1d5b2e9b0a0872eecb26f.zip |
Use unordered_map instead of map for craft definitions (#8432)
Diffstat (limited to 'src/craftdef.cpp')
-rw-r--r-- | src/craftdef.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/craftdef.cpp b/src/craftdef.cpp index 077d7e044..04e418e29 100644 --- a/src/craftdef.cpp +++ b/src/craftdef.cpp @@ -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() |