mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
hashset.hpp
This commit is contained in:
parent
7b1ba40d49
commit
80d74f33bb
1 changed files with 13 additions and 0 deletions
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "khash.h"
|
||||
#include "wyhash.h"
|
||||
#include <cstdint>
|
||||
|
||||
#define NAME str_set
|
||||
#define KEY_TY const char*
|
||||
|
|
@ -29,6 +30,18 @@
|
|||
|
||||
KHASH_SET_INIT_INT64(hashset);
|
||||
|
||||
static
|
||||
inline
|
||||
uint64_t
|
||||
vt_hash_const_string(const char *key_)
|
||||
{
|
||||
int64_t hash = 0xcbf29ce484222325ull;
|
||||
while( *key )
|
||||
hash = ( (unsigned char)*key++ ^ hash ) * 0x100000001b3ull;
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
class HashSet
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue