13 Apr
2010
13 Apr
'10
10:44 p.m.
Liu Linyong wrote:
Hello Alan,
I have a question. For V2-1-7, in hash.c, please refer to the follows,
static int list_delete(fr_hash_table_t *ht, fr_hash_entry_t **head, fr_hash_entry_t *node) { ...... for (cur = *head; cur != &ht->null; cur = cur->next) { if (cur == node) { // WHY NOT "if (cur->reversed == node->reversed)" ???
On closer inspection, this function should just be: ... for (cur = *head; cur != &ht->null; cur = cur->next) { if (cur == node) break; last = &(cur->next); } ... The only caller has already ensured that 'node' points to an entry in that list. So if 'cur == node', the 'cur' entry is deleted. Alan DeKok.