Răsfoiți Sursa

cache: use identity as hashing function

Michele Caini 4 ani în urmă
părinte
comite
17a9cd5666
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 0 1
      TODO
  2. 2 1
      src/entt/resource/cache.hpp

+ 0 - 1
TODO

@@ -4,7 +4,6 @@
 * add examples (and credits) from @alanjfs :)
 
 WIP:
-* use identity with dense hash map: cache (review api with hashed string), registry
 * fast-contains for sparse sets (low prio but nice-to-have)
 * runtime components (registry), runtime events (dispatcher/emitter), runtime context variables ...
 * runtime_view/registry, remove reference to basic_sparse_set<E>

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

@@ -6,6 +6,7 @@
 #include "../config/config.h"
 #include "../container/dense_hash_map.hpp"
 #include "../core/fwd.hpp"
+#include "../core/utility.hpp"
 #include "fwd.hpp"
 #include "handle.hpp"
 #include "loader.hpp"
@@ -271,7 +272,7 @@ public:
     }
 
 private:
-    dense_hash_map<id_type, resource_handle<resource_type>> resources;
+    dense_hash_map<id_type, resource_handle<resource_type>, identity> resources;
 };
 
 } // namespace entt