core: hashes - small helper macro to compute hash slot index
authorDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 21 Apr 2020 15:30:37 +0000 (17:30 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 21 Apr 2020 15:30:37 +0000 (17:30 +0200)
src/core/hashes.h

index 5b8e2f2..2afb836 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "str.h"
 
-
+#define core_hash_idx(hid, hsize) ((hid)&(hsize-1))
 
 /** internal use: hash update
  * params: char* s   - string start,