Bläddra i källkod

registry: combine dense hash maps and identity when the key is a hashed string already

Michele Caini 4 år sedan
förälder
incheckning
fc3de662c3
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      src/entt/entity/registry.hpp

+ 3 - 2
src/entt/entity/registry.hpp

@@ -16,6 +16,7 @@
 #include "../core/fwd.hpp"
 #include "../core/type_info.hpp"
 #include "../core/type_traits.hpp"
+#include "../core/utility.hpp"
 #include "component.hpp"
 #include "entity.hpp"
 #include "fwd.hpp"
@@ -1565,8 +1566,8 @@ public:
     }
 
 private:
-    mutable dense_hash_map<id_type, pool_data> pools{};
-    dense_hash_map<id_type, basic_any<0u>> vars{};
+    mutable dense_hash_map<id_type, pool_data, identity> pools{};
+    dense_hash_map<id_type, basic_any<0u>, identity> vars{};
     std::vector<group_data> groups{};
     std::vector<entity_type> entities{};
     entity_type free_list{tombstone};