Skip to content
Permalink
Browse files

Use unordered_map instead of map for craft definitions (#8432)

  • Loading branch information
HybridDog authored and nerzhul committed Mar 31, 2019
1 parent ad75dba commit ab322fc5aa0b81375aa1d5b2e9b0a0872eecb26f
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/craftdef.cpp
@@ -922,7 +922,7 @@ class CCraftDefManager: public IWritableCraftDefManager

// 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 @@ class CCraftDefManager: public IWritableCraftDefManager
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()

0 comments on commit ab322fc

Please sign in to comment.