aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libucl/khash.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-15 15:33:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-15 15:33:29 +0100
commit5766eb4b96808e998f19f13a3db242fec070f51b (patch)
treeadd81b476d1c0fffcd6076790008fb7f2cf831c3 /contrib/libucl/khash.h
parentf01c0800f7a9caf1b2b4e9c58b044d5def09e76a (diff)
downloadrspamd-5766eb4b96808e998f19f13a3db242fec070f51b.tar.gz
rspamd-5766eb4b96808e998f19f13a3db242fec070f51b.zip
[Minor] Slightly refactor set iteration
Diffstat (limited to 'contrib/libucl/khash.h')
-rw-r--r--contrib/libucl/khash.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/libucl/khash.h b/contrib/libucl/khash.h
index a91db5b2a..3e580011d 100644
--- a/contrib/libucl/khash.h
+++ b/contrib/libucl/khash.h
@@ -583,6 +583,14 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key)
code; \
} }
+#define kh_foreach_key(h, kvar, code) { \
+ khint_t __i; \
+ for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \
+ if (!kh_exist(h,__i)) continue; \
+ (kvar) = kh_key(h,__i); \
+ code; \
+ } }
+
/* More conenient interfaces */
/*! @function