Bug 328106: Removal of HT_ENUMERATE_UNHASH. Its implementation had a bug

for 11 years which is a good demonstration that it has never been used.
This commit is contained in:
igor%mir2.org 2006-02-23 10:11:17 +00:00
parent 1ce5986f6b
commit 11e703be51
2 changed files with 3 additions and 6 deletions

@ -361,12 +361,10 @@ JS_HashTableEnumerateEntries(JSHashTable *ht, JSHashEnumerator f, void *arg)
while ((he = *hep) != NULL) {
rv = f(he, n, arg);
n++;
if (rv & (HT_ENUMERATE_REMOVE | HT_ENUMERATE_UNHASH)) {
if (rv & HT_ENUMERATE_REMOVE) {
*hep = he->next;
if (rv & HT_ENUMERATE_REMOVE) {
he->next = todo;
todo = he;
}
he->next = todo;
todo = he;
} else {
hep = &he->next;
}

@ -64,7 +64,6 @@ typedef intN (* JS_DLL_CALLBACK JSHashEnumerator)(JSHashEntry *he, intN i, void
#define HT_ENUMERATE_NEXT 0 /* continue enumerating entries */
#define HT_ENUMERATE_STOP 1 /* stop enumerating entries */
#define HT_ENUMERATE_REMOVE 2 /* remove and free the current entry */
#define HT_ENUMERATE_UNHASH 4 /* just unhash the current entry */
typedef struct JSHashAllocOps {
void * (*allocTable)(void *pool, size_t size);