Conditionals tests in cfulist_delete_data_with_free_fn() were simplified
This commit is contained in:
		| @@ -429,10 +429,7 @@ cfulist_delete_data_with_free_fn(cfulist_t *list, void *data, cfulist_free_fn_t | |||||||
| 	cfulist_entry *entry = list->entries; | 	cfulist_entry *entry = list->entries; | ||||||
| 	while (entry) | 	while (entry) | ||||||
| 	{  | 	{  | ||||||
| 		if (entry->data != data) { | 		if (entry->data == data) { | ||||||
| 			entry = entry->next; |  | ||||||
| 			continue; |  | ||||||
| 		} else { |  | ||||||
| 			if (!entry->prev) { | 			if (!entry->prev) { | ||||||
| 				if (entry->next) { | 				if (entry->next) { | ||||||
| 					assert(list->num_entries > 1); | 					assert(list->num_entries > 1); | ||||||
| @@ -451,6 +448,7 @@ cfulist_delete_data_with_free_fn(cfulist_t *list, void *data, cfulist_free_fn_t | |||||||
| 			--list->num_entries; | 			--list->num_entries; | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
|  | 		entry = entry->next; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	unlock_list(list); | 	unlock_list(list); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user