Try to use ankerl::unordered_dense::map instead of std::unordered_map in UnorderedMapStorage

This commit is contained in:
Siarhei Fedartsou
2024-05-30 19:21:38 +02:00
parent 0f5ffc2a84
commit c3683201e6
2258 changed files with 3 additions and 468 deletions
+3 -5
View File
@@ -5,11 +5,11 @@
#include <boost/heap/d_ary_heap.hpp>
#include <algorithm>
#include <ankerl/unordered_dense.h>
#include <cstdint>
#include <limits>
#include <map>
#include <optional>
#include <ankerl/unordered_dense.h>
#include <vector>
namespace osrm::util
@@ -56,9 +56,7 @@ template <typename NodeID, typename Key> class MapStorage
template <typename NodeID, typename Key> class UnorderedMapStorage
{
public:
explicit UnorderedMapStorage(std::size_t) {
nodes.rehash(1000);
}
explicit UnorderedMapStorage(std::size_t) { nodes.rehash(1000); }
Key &operator[](const NodeID node) { return nodes[node]; }
@@ -81,7 +79,7 @@ template <typename NodeID, typename Key> class UnorderedMapStorage
void Clear() { nodes.clear(); }
private:
ankerl::unordered_dense::map<NodeID, Key> nodes;
ankerl::unordered_dense::map<NodeID, Key> nodes;
};
template <typename NodeID,