Skip to content

Commit ab322fc

Browse files
HybridDognerzhul
authored andcommittedMar 31, 2019
Use unordered_map instead of map for craft definitions (#8432)
1 parent ad75dba commit ab322fc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/craftdef.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ class CCraftDefManager: public IWritableCraftDefManager
922922

923923
// Get output, then decrement input (if requested)
924924
output = out;
925-
925+
926926
if (decrementInput)
927927
def->decrementInput(input, output_replacement, gamedef);
928928
/*errorstream << "Check RETURNS TRUE" << std::endl;*/
@@ -1099,9 +1099,10 @@ class CCraftDefManager: public IWritableCraftDefManager
10991099
unhashed.clear();
11001100
}
11011101
private:
1102-
//TODO: change both maps to unordered_map when c++11 can be used
1103-
std::vector<std::map<u64, std::vector<CraftDefinition*> > > m_craft_defs;
1104-
std::map<std::string, std::vector<CraftDefinition*> > m_output_craft_definitions;
1102+
std::vector<std::unordered_map<u64, std::vector<CraftDefinition*> > >
1103+
m_craft_defs;
1104+
std::unordered_map<std::string, std::vector<CraftDefinition*> >
1105+
m_output_craft_definitions;
11051106
};
11061107

11071108
IWritableCraftDefManager* createCraftDefManager()

0 commit comments

Comments
 (0)
Please sign in to comment.