analyze: use while() when for() is less fit to purpose

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2016-07-03 14:00:00 +01:00
parent d26c858c13
commit 1b35a16d95
No known key found for this signature in database
GPG key ID: A9553245FDE9B739

View file

@ -65,8 +65,8 @@ void do_counting(void)
/* Walk through ranges */ /* Walk through ranges */
range_p = ranges; range_p = ranges;
for (i = 0; i < num_ranges; i++) { for (i = 0; i < num_ranges; i++) {
for (; l != NULL && ipcomp(&range_p->first_ip, &l->ip) < 0; l = l->hh.prev) while (l != NULL && ipcomp(&range_p->first_ip, &l->ip) < 0)
/* rewind */ ; l = l->hh.prev; /* rewind */
if (l == NULL) if (l == NULL)
l = leases; l = leases;
for (; l != NULL && ipcomp(&l->ip, &range_p->last_ip) <= 0; l = l->hh.next) { for (; l != NULL && ipcomp(&l->ip, &range_p->last_ip) <= 0; l = l->hh.next) {