mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-27 10:08:39 +00:00
make use of meow hash in the hash table
This commit is contained in:
parent
382ef60919
commit
b9a65135ff
|
|
@ -15,6 +15,8 @@
|
|||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "../Hash/MeowHash.h"
|
||||
|
||||
namespace Stdlib
|
||||
{
|
||||
namespace HashTable
|
||||
|
|
@ -42,13 +44,12 @@ namespace Stdlib
|
|||
inline
|
||||
unsigned long long hash_key(const char *key)
|
||||
{
|
||||
unsigned long long hash = 14695981039346656037UL;
|
||||
for (const char *p = key; *p; ++p) {
|
||||
hash ^= (unsigned long long)(unsigned char)(*p);
|
||||
hash *= 1099511628211UL;
|
||||
}
|
||||
|
||||
return hash;
|
||||
return (unsigned long long) MeowU64From(
|
||||
Hash::Meow::MeowHash(Hash::Meow::MeowDefaultSeed,
|
||||
strlen(key),
|
||||
(void *) key),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
ht *create_table(int max = 0, bool is_fixed = false)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user