Test UC_HTABLE_FOR_EACH
This commit is contained in:
@@ -99,6 +99,7 @@ struct UHNode *uc_htable_first_hash(const struct UHTable *table, size_t hash);
|
||||
|
||||
//internal helper
|
||||
struct UHNode *uc_htable_next_hash_hlp(struct UHNode *next, size_t hash);
|
||||
|
||||
/**
|
||||
* Get the next node with the same hash
|
||||
* @param node previous node
|
||||
@@ -111,7 +112,7 @@ static inline struct UHNode *uc_htable_next_hash(const struct UHNode *node)
|
||||
|
||||
|
||||
//internal helper
|
||||
struct UHNode *uc_htable_next_hlp(struct UHTable *table, size_t bucket);
|
||||
struct UHNode *uc_htable_iter_hlp(struct UHTable *table, size_t bucket);
|
||||
|
||||
/** Get the first node in the hash table
|
||||
*
|
||||
@@ -120,7 +121,7 @@ struct UHNode *uc_htable_next_hlp(struct UHTable *table, size_t bucket);
|
||||
*/
|
||||
static inline struct UHNode *uc_htable_first(struct UHTable *table)
|
||||
{
|
||||
return uc_htable_next_hlp(table, 0);
|
||||
return uc_htable_iter_hlp(table, 0);
|
||||
}
|
||||
|
||||
/** Get the next node in the hash table
|
||||
@@ -149,7 +150,7 @@ void uc_htable_swap(struct UHTable *a, struct UHTable *b);
|
||||
(node_iter) != NULL;\
|
||||
(node_iter) = uc_htable_next_hash((node_iter)))
|
||||
|
||||
#define UC_HTABLE_FOREACH(table, node_iter, hash)\
|
||||
#define UC_HTABLE_FOREACH(table, node_iter)\
|
||||
for ((node_iter) = uc_htable_first((table));\
|
||||
(node_iter) != NULL;\
|
||||
(node_iter) = uc_htable_next((table), (node_iter)))
|
||||
|
||||
Reference in New Issue
Block a user