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

This commit is contained in:
Michele Caini
2021-10-21 08:07:58 +02:00
parent 2866dcdd03
commit b59d3ebeaa
3 changed files with 6 additions and 6 deletions

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -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