Skip to content
Snippets Groups Projects
Commit a36b1fe8 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Clear assoc.h from unused hash definitions.

parent 0d2be495
No related branches found
No related tags found
No related merge requests found
......@@ -26,9 +26,7 @@
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <pickle.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#if !MH_SOURCE
#define MH_UNDEF
......@@ -49,54 +47,3 @@ struct mh_i32ptr_node_t {
#define mh_eq(a, b, arg) ((a->key) == (b->key))
#include <mhash.h>
/*
* Map: (i64) => (void *)
*/
#define mh_name _i64ptr
struct mh_i64ptr_node_t {
uint64_t key;
void *val;
};
#define mh_node_t struct mh_i64ptr_node_t
#define mh_int_t uint32_t
#define mh_arg_t void *
#define mh_hash(a, arg) ((uint32_t)((a->key)>>33^(a->key)^(a->key)<<11))
#define mh_eq(a, b, arg) ((a->key) == (b->key))
#include <mhash.h>
/*
* Map: (char *) => (void *)
*/
static inline int lstrcmp(const char *a, const char *b)
{
unsigned int al, bl;
al = load_varint32(&a);
bl = load_varint32(&b);
if (al != bl)
return bl - al;
return memcmp(a, b, al);
}
#include <third_party/PMurHash.h>
#define mh_name _lstrptr
struct mh_lstrptr_node_t {
const char *key;
void *val;
};
#define mh_node_t struct mh_lstrptr_node_t
#define mh_int_t uint32_t
#define mh_arg_t void *
static inline uint32_t
mh_strptr_hash(const mh_node_t *a, mh_arg_t arg) {
(void) arg;
const char *_k = a->key;
const uint32_t l = load_varint32(&_k);
return PMurHash32(13, _k, l);
}
#define mh_hash(a, arg) mh_strptr_hash(a, arg)
#define mh_eq(a, b, arg) (lstrcmp(a->key, b->key) == 0)
#include <mhash.h>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment