2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

use ISC_LIST_FOREACH in more places

use the ISC_LIST_FOREACH pattern in places where lists had
been iterated using a different pattern from the typical
`for` loop: for example, `while (!ISC_LIST_EMPTY(...))` or
`while ((e = ISC_LIST_HEAD(...)) != NULL)`.
This commit is contained in:
Evan Hunt
2025-03-22 15:26:16 -07:00
parent 522ca7bb54
commit ad7f744115
38 changed files with 181 additions and 430 deletions

View File

@@ -129,9 +129,8 @@ dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff) {
void
dns_diff_clear(dns_diff_t *diff) {
dns_difftuple_t *t;
REQUIRE(DNS_DIFF_VALID(diff));
while ((t = ISC_LIST_HEAD(diff->tuples)) != NULL) {
ISC_LIST_FOREACH_SAFE (diff->tuples, t, link) {
ISC_LIST_UNLINK(diff->tuples, t, link);
dns_difftuple_free(&t);
}