From 0f2307e6680a3723c8f84aa08e7e70efd53d238d Mon Sep 17 00:00:00 2001 From: H1ghBre4k3r Date: Mon, 3 May 2021 21:28:12 +0200 Subject: [PATCH] Records: In iterator_next, combine if-guard with while-loop --- src/ens/records.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ens/records.c b/src/ens/records.c index 37e12a9..f4b8d86 100644 --- a/src/ens/records.c +++ b/src/ens/records.c @@ -102,14 +102,9 @@ int ens_records_iterator_init_timerange(record_iterator_t* iterator, uint32_t* t } record_t* ens_records_iterator_next(record_iterator_t* iter) { - if (iter->finished) { - return NULL; - } - record_t* next = NULL; - // What is this? - while (next == NULL) { + while (next == NULL && !iter->finished) { record_t contact; // try to load the next contact int res = load_contact(&contact, iter->sn_next);