From 57a1b0f31e516740463104912ecfc740c834c6cd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 20 Feb 2020 13:01:19 +1030 Subject: [PATCH] htable: add htable_type _delval. To match the raw delval Signed-off-by: Rusty Russell --- ccan/htable/htable_type.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ccan/htable/htable_type.h b/ccan/htable/htable_type.h index 192824c2..bb5ea086 100644 --- a/ccan/htable/htable_type.h +++ b/ccan/htable/htable_type.h @@ -35,6 +35,9 @@ * bool _del(struct *ht, const *e); * bool _delkey(struct *ht, const *k); * + * Delete by iterator: + * bool _delval(struct *ht, struct _iter *i); + * * Find and return the (first) matching element, or NULL: * type *_get(const struct @name *ht, const *k); * @@ -147,6 +150,11 @@ return name##_del(ht, elem); \ return false; \ } \ + static inline UNNEEDED void name##_delval(struct name *ht, \ + struct name##_iter *iter) \ + { \ + htable_delval(&ht->raw, &iter->i); \ + } \ static inline UNNEEDED type *name##_pick(const struct name *ht, \ size_t seed, \ struct name##_iter *iter) \ -- 2.39.2