Skip to content

Commit

Permalink
Use unordered_map instead of map for craft definitions (#8432)
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridDog authored and nerzhul committed Mar 31, 2019
1 parent ad75dba commit ab322fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/craftdef.cpp
Expand Up @@ -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;*/
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ab322fc

Please sign in to comment.