Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
LBM content mapping map doesn't need to be ordered, use std::unordere…
…d_map

Also rename helper to lbm_map instead of container_map
  • Loading branch information
nerzhul committed Jul 18, 2017
1 parent 14a1a71 commit a8c405b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/serverenvironment.cpp
Expand Up @@ -109,7 +109,7 @@ void LBMContentMapping::addLBM(LoadingBlockModifierDef *lbm_def, IGameDef *gamed
const std::vector<LoadingBlockModifierDef *> *
LBMContentMapping::lookup(content_t c) const
{
container_map::const_iterator it = map.find(c);
lbm_map::const_iterator it = map.find(c);
if (it == map.end())
return NULL;
// This first dereferences the iterator, returning
Expand Down
4 changes: 2 additions & 2 deletions src/serverenvironment.h
Expand Up @@ -88,8 +88,8 @@ struct LoadingBlockModifierDef

struct LBMContentMapping
{
typedef std::map<content_t, std::vector<LoadingBlockModifierDef *> > container_map;
container_map map;
typedef std::unordered_map<content_t, std::vector<LoadingBlockModifierDef *>> lbm_map;
lbm_map map;

std::vector<LoadingBlockModifierDef *> lbm_list;

Expand Down

0 comments on commit a8c405b

Please sign in to comment.