Skip to content

Commit a8c405b

Browse files
committedJul 18, 2017
LBM content mapping map doesn't need to be ordered, use std::unordered_map
Also rename helper to lbm_map instead of container_map
1 parent 14a1a71 commit a8c405b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/serverenvironment.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void LBMContentMapping::addLBM(LoadingBlockModifierDef *lbm_def, IGameDef *gamed
109109
const std::vector<LoadingBlockModifierDef *> *
110110
LBMContentMapping::lookup(content_t c) const
111111
{
112-
container_map::const_iterator it = map.find(c);
112+
lbm_map::const_iterator it = map.find(c);
113113
if (it == map.end())
114114
return NULL;
115115
// This first dereferences the iterator, returning

‎src/serverenvironment.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ struct LoadingBlockModifierDef
8888

8989
struct LBMContentMapping
9090
{
91-
typedef std::map<content_t, std::vector<LoadingBlockModifierDef *> > container_map;
92-
container_map map;
91+
typedef std::unordered_map<content_t, std::vector<LoadingBlockModifierDef *>> lbm_map;
92+
lbm_map map;
9393

9494
std::vector<LoadingBlockModifierDef *> lbm_list;
9595

0 commit comments

Comments
 (0)
Please sign in to comment.