Daniel Lehman dlehman25@gmail.com wrote:
- if (curr) {
for (; attrIndex < index; attrIndex++) {
if (curr->next == NULL)
break;
else
curr = curr->next;
}
I understand that this is mostly a personal preference and there are other places that use similar style, but wouldn't it be more clear without 'else' or even this way:
if (curr) { for (; attrIndex < index && curr->next != NULL; attrIndex++) { curr = curr->next; }
- for (; attrIndex < index; attrIndex++) {
if (ns->next == NULL) return S_FALSE; else
curr = curr->next;
}ns = ns->next;
Same question about redundant 'else'.