]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
LBM content mapping map doesn't need to be ordered, use std::unordered_map
authorLoic Blot <loic.blot@unix-experience.fr>
Tue, 18 Jul 2017 06:23:37 +0000 (08:23 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Tue, 18 Jul 2017 06:23:37 +0000 (08:23 +0200)
Also rename helper to lbm_map instead of container_map

src/serverenvironment.cpp
src/serverenvironment.h

index 11c71e28efeeb9f10f6459fd9dc17528145a07cf..bf4b3c0e3eee974c35cb30a30cd6a06b997c3863 100644 (file)
@@ -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
index 48eb5b3185da29ba4a66a34b5d82c964868f03ce..4cfe7f7d646ee44404e454313500f0e28a694852 100644 (file)
@@ -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;