mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-28 00:43:38 +00:00
[core] Switch to ankerl::unordered_dense
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace platform
|
||||
{
|
||||
// class GetTextById is ready to work with different sources of text strings.
|
||||
@@ -40,7 +41,7 @@ private:
|
||||
bool IsValid() const { return !m_localeTexts.empty(); }
|
||||
|
||||
std::string m_locale;
|
||||
std::unordered_map<std::string, std::string> m_localeTexts;
|
||||
ankerl::unordered_dense::map<std::string, std::string> m_localeTexts;
|
||||
};
|
||||
|
||||
/// Factories to create GetTextById instances.
|
||||
|
||||
@@ -27,9 +27,10 @@ SOFTWARE.
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace platform
|
||||
{
|
||||
class HttpClient
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
std::string m_value;
|
||||
};
|
||||
|
||||
using Headers = std::unordered_map<std::string, std::string>;
|
||||
using Headers = ankerl::unordered_dense::map<std::string, std::string>;
|
||||
|
||||
HttpClient() = default;
|
||||
explicit HttpClient(std::string const & url);
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
#include <cctype>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@ void EnumerateFiles(std::string const & directory, std::function<void(char const
|
||||
void EnumerateFilesByRegExp(std::string const & directory, boost::regex const & regexp, std::vector<std::string> & res);
|
||||
|
||||
inline void EnumerateFiles(std::string const & directory, std::vector<std::string> & res)
|
||||
{
|
||||
EnumerateFiles(directory, [&](char const * entry)
|
||||
{
|
||||
res.push_back(std::string(entry));
|
||||
});
|
||||
{
|
||||
EnumerateFiles(directory, [&](char const * entry) { res.push_back(std::string(entry)); });
|
||||
}
|
||||
} // namespace pl
|
||||
|
||||
Reference in New Issue
Block a user