for (;;) {
if (yf_list_get(&some_list, (void **) &some_element) == -1) break;
if (!some_element) break; // this only sometimes
// actually do code
yf_list_next(&node->params);
}
Refactor it so it fits into a for loop header like:
for (yf_list_reset(&some_list); yf_in_list(&some_list); yf_list_get(&some_list, &some_element)) {
// actually do code
}
The most common list looping pattern is:
Refactor it so it fits into a for loop header like: