From a5a5487023fb1d987c6f19e8e6327f4ea472d4d8 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 20 Mar 2015 10:27:40 +1100 Subject: [PATCH] Revert "Add uthash helpers for iterating over hash entries without the need for safe against deletion" This reverts commit 9a1e59637f7c2f98be1af55b7019238626b0c40a. Broken. --- src/uthash.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/uthash.h b/src/uthash.h index ce61e339..31db3fa8 100644 --- a/src/uthash.h +++ b/src/uthash.h @@ -869,21 +869,14 @@ do { (sizeof(UT_hash_table)) + \ (HASH_BLOOM_BYTELEN))) -/* HASH_ITERATE and HASH_FOREACH are not safe for deletion */ -#define HASH_ITERATE(head,el) HASH_ITERATE2(hh,head,el) -#define HASH_FOREACH(hh,head,el) HASH_ITERATE2(hh,head,el) #ifdef NO_DECLTYPE #define HASH_ITER(hh,head,el,tmp) \ for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) -#define HASH_ITERATE2(hh,head,el) \ -for ((el)=(head); ((head)!= NULL); (head)=(head)->hh.next) #else #define HASH_ITER(hh,head,el,tmp) \ for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL)) -#define HASH_ITERATE2(hh,head,el) \ -for ((el)=(head); ((head)!= NULL); (head)=DECLTYPE(el)(head)->hh.next) #endif /* obtain a count of items in the hash */