[core] Switch to ankerl::unordered_dense

Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
x7z4w
2025-11-24 17:34:56 +00:00
parent 03132c6877
commit ef6522ed28
282 changed files with 4386 additions and 1456 deletions

View File

@@ -15,10 +15,12 @@
#include <utility>
#include <vector>
#include "3party/ankerl/unordered_dense.h"
namespace generator
{
using base::GeoObjectId;
using std::pair, std::string, std::unordered_map, std::vector;
using std::pair, std::string, ankerl::unordered_dense::map, std::vector;
DECLARE_EXCEPTION(ParsingError, RootException);
@@ -42,7 +44,7 @@ static void ParseFeatureToBrand(json_t * root, string const & field, GeoObjectId
}
}
void ParseTranslations(json_t * root, std::set<string> const & keys, unordered_map<uint32_t, string> & idToKey)
void ParseTranslations(json_t * root, std::set<string> const & keys, map<uint32_t, string> & idToKey)
{
string const empty;
auto getKey = [&](string & translation) -> string const &
@@ -81,8 +83,7 @@ void ParseTranslations(json_t * root, std::set<string> const & keys, unordered_m
}
}
bool LoadBrands(string const & brandsFilename, string const & translationsFilename,
unordered_map<GeoObjectId, string> & brands)
bool LoadBrands(string const & brandsFilename, string const & translationsFilename, map<GeoObjectId, string> & brands)
{
string jsonBuffer;
try
@@ -126,7 +127,7 @@ bool LoadBrands(string const & brandsFilename, string const & translationsFilena
return false;
}
unordered_map<uint32_t, string> idToKey;
map<uint32_t, string> idToKey;
try
{
base::Json root(jsonBuffer.c_str());