mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-07 04:53:54 +00:00
[core] Switch to ankerl::unordered_dense
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -5,9 +5,10 @@
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace base
|
||||
{
|
||||
|
||||
@@ -79,7 +80,7 @@ public:
|
||||
template <class Key>
|
||||
class TopStatsCounter
|
||||
{
|
||||
std::unordered_map<Key, size_t> m_data;
|
||||
ankerl::unordered_dense::map<Key, size_t> m_data;
|
||||
|
||||
public:
|
||||
void Add(Key const & key) { ++m_data[key]; }
|
||||
@@ -88,7 +89,7 @@ public:
|
||||
{
|
||||
ASSERT(count > 0, ());
|
||||
|
||||
using PtrT = std::pair<Key const, size_t> const *;
|
||||
using PtrT = typename ankerl::unordered_dense::map<Key, size_t>::value_type const *;
|
||||
struct GreaterNumber
|
||||
{
|
||||
bool operator()(PtrT l, PtrT r) const { return l->second > r->second; }
|
||||
|
||||
Reference in New Issue
Block a user