mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
boost::hash_combine removed
This commit is contained in:
parent
e1a0a99579
commit
10741cdbcc
4 changed files with 16 additions and 9 deletions
|
@ -3,9 +3,9 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
namespace Core {
|
||||
namespace Util {
|
||||
namespace Core::Util {
|
||||
|
||||
std::string binaryToHexString( uint8_t* pBinData, uint16_t size );
|
||||
|
||||
|
@ -24,7 +24,14 @@ int64_t getTimeSeconds();
|
|||
uint64_t getEorzeanTimeStamp();
|
||||
|
||||
void valueToFlagByteIndexValue( uint32_t inVal, uint8_t& outVal, uint16_t& outIndex );
|
||||
|
||||
template <class T>
|
||||
inline void hashCombine( std::size_t& seed, const T& v )
|
||||
{
|
||||
std::hash<T> hasher;
|
||||
seed ^= hasher( v ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/xml_parser.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <Logging/Logger.h>
|
||||
#include <Config/ConfigMgr.h>
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <asio.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#include <Util/Util.h>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <thread>
|
||||
|
@ -23,10 +23,11 @@ public:
|
|||
};
|
||||
class case_insensitive_hash {
|
||||
public:
|
||||
size_t operator()(const std::string &key) const {
|
||||
size_t operator()( const std::string &key ) const
|
||||
{
|
||||
std::size_t seed=0;
|
||||
for(auto &c: key)
|
||||
boost::hash_combine(seed, std::tolower(c));
|
||||
for( auto &c : key )
|
||||
Core::Util::hashCombine< char >( seed, std::tolower( c ) );
|
||||
return seed;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define CLIENT_HTTP_HPP
|
||||
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#include <asio.hpp>
|
||||
|
||||
|
@ -11,6 +10,7 @@
|
|||
#include <random>
|
||||
#include <mutex>
|
||||
#include <type_traits>
|
||||
#include <hash>
|
||||
|
||||
class case_insensitive_equals {
|
||||
public:
|
||||
|
@ -23,7 +23,7 @@ public:
|
|||
size_t operator()( const std::string &key ) const {
|
||||
std::size_t seed = 0;
|
||||
for( auto &c : key )
|
||||
boost::hash_combine( seed, std::tolower( c ) );
|
||||
Core::Util::hashCombine< char >( seed, std::tolower( c ) );
|
||||
return seed;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue