mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-16 16:12:14 +11:00
🚚 moved xxHashStringGen to bank.h
This commit is contained in:
parent
1f49a9b79a
commit
1cc1a41561
1 changed files with 8 additions and 2 deletions
|
|
@ -4,7 +4,6 @@
|
|||
#include <shared_mutex>
|
||||
#include <drogon/HttpTypes.h>
|
||||
#include <parallel-hashmap/parallel_hashmap/phmap.h>
|
||||
#include "xxhash_strfunctor.hpp"
|
||||
#include "user.h"
|
||||
|
||||
#if CONSERVATIVE_DISK_SAVE && MAX_LOG_SIZE < 0
|
||||
|
|
@ -15,6 +14,14 @@ using BankResponse = std::pair<drogon::HttpStatusCode, Json::Value>;
|
|||
|
||||
class Bank
|
||||
{
|
||||
struct xxHashStringGen
|
||||
{
|
||||
inline uint64_t operator()(const std::string &str) const
|
||||
{
|
||||
return XXH3_64bits(str.data(), str.size());
|
||||
}
|
||||
};
|
||||
|
||||
phmap::parallel_flat_hash_map<
|
||||
std::string, User,
|
||||
xxHashStringGen,
|
||||
|
|
@ -58,7 +65,6 @@ public:
|
|||
|
||||
BankResponse AddUser(const std::string &name, std::string &&init_pass) noexcept;
|
||||
BankResponse AdminAddUser(std::string &&name, uint32_t init_bal, std::string &&init_pass) noexcept;
|
||||
|
||||
BankResponse DelUser(const std::string &name) noexcept;
|
||||
|
||||
void Save();
|
||||
|
|
|
|||
Loading…
Reference in a new issue