mruby.h: move integer hash function from khash.h

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-03-20 23:25:17 +09:00
parent 3ccc98fa32
commit 96fa3461f0
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -1543,6 +1543,8 @@ mrbmemset(void *s, int c, size_t n)
#define memset(a,b,c) mrbmemset(a,b,c)
#endif
#define mrb_int_hash_func(mrb,key) (uint32_t)((key)^((key)<<2)^((key)>>2))
MRB_END_DECL
#endif /* MRUBY_H */
+1 -1
View File
@@ -264,7 +264,7 @@ kh_fill_flags(uint8_t *p, uint8_t c, size_t len)
#define kh_size(h) ((h)->size)
#define kh_n_buckets(h) ((h)->n_buckets)
#define kh_int_hash_func(mrb,key) (khint_t)((key)^((key)<<2)^((key)>>2))
#define kh_int_hash_func(mrb,key) mrb_int_hash_func(mrb,key)
#define kh_int_hash_equal(mrb,a, b) (a == b)
#define kh_int64_hash_func(mrb,key) (khint_t)((key)>>33^(key)^(key)<<11)
#define kh_int64_hash_equal(mrb,a, b) (a == b)