Răsfoiți Sursa

*: dense_hash_map being a drop-in replacement for unordered_map has its advantages :)

Michele Caini 4 ani în urmă
părinte
comite
b59d3ebeaa

+ 2 - 2
src/entt/entity/organizer.hpp

@@ -4,9 +4,9 @@
 #include <algorithm>
 #include <cstddef>
 #include <type_traits>
-#include <unordered_map>
 #include <utility>
 #include <vector>
+#include "../container/dense_hash_map.hpp"
 #include "../core/type_info.hpp"
 #include "../core/type_traits.hpp"
 #include "fwd.hpp"
@@ -477,7 +477,7 @@ public:
     }
 
 private:
-    std::unordered_map<id_type, std::vector<std::pair<std::size_t, bool>>> dependencies;
+    dense_hash_map<id_type, std::vector<std::pair<std::size_t, bool>>> dependencies;
     std::vector<vertex_data> vertices;
 };
 

+ 2 - 2
src/entt/entity/snapshot.hpp

@@ -6,10 +6,10 @@
 #include <iterator>
 #include <tuple>
 #include <type_traits>
-#include <unordered_map>
 #include <utility>
 #include <vector>
 #include "../config/config.h"
+#include "../container/dense_hash_map.hpp"
 #include "../core/type_traits.hpp"
 #include "entity.hpp"
 #include "fwd.hpp"
@@ -548,7 +548,7 @@ public:
     }
 
 private:
-    std::unordered_map<entity_type, std::pair<entity_type, bool>> remloc;
+    dense_hash_map<entity_type, std::pair<entity_type, bool>> remloc;
     basic_registry<entity_type> *reg;
 };
 

+ 2 - 2
src/entt/resource/cache.hpp

@@ -2,9 +2,9 @@
 #define ENTT_RESOURCE_CACHE_HPP
 
 #include <type_traits>
-#include <unordered_map>
 #include <utility>
 #include "../config/config.h"
+#include "../container/dense_hash_map.hpp"
 #include "../core/fwd.hpp"
 #include "fwd.hpp"
 #include "handle.hpp"
@@ -271,7 +271,7 @@ public:
     }
 
 private:
-    std::unordered_map<id_type, resource_handle<resource_type>> resources;
+    dense_hash_map<id_type, resource_handle<resource_type>> resources;
 };
 
 } // namespace entt