line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
#include "string_view/defs.h" |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
namespace panda { namespace hash { |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
uint64_t hash_murmur64a (string_view); |
10
|
|
|
|
|
|
|
uint32_t hash_jenkins_one_at_a_time (string_view); |
11
|
|
|
|
|
|
|
|
12
|
274
|
|
|
|
|
|
inline uint64_t hash64 (string_view v) { return hash_murmur64a(v); } |
13
|
|
|
|
|
|
|
inline uint32_t hash32 (string_view v) { return hash_jenkins_one_at_a_time(v); } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
namespace { |
16
|
|
|
|
|
|
|
template struct _hashXX; |
17
|
|
|
|
|
|
|
template <> struct _hashXX<4> { uint32_t operator() (string_view v) { return hash32(v); } }; |
18
|
274
|
|
|
|
|
|
template <> struct _hashXX<8> { uint64_t operator() (string_view v) { return hash64(v); } }; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
template inline T hashXX (string_view); |
22
|
|
|
|
|
|
|
template <> inline unsigned hashXX (string_view v) { return _hashXX()(v); } |
23
|
137
|
50
|
|
|
|
|
template <> inline unsigned long hashXX (string_view v) { return _hashXX()(v); } |
24
|
|
|
|
|
|
|
template <> inline unsigned long long hashXX (string_view v) { return _hashXX()(v); } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
}} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#include "string_view.h" |