summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--stc/clist.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/stc/clist.h b/stc/clist.h
index 0b8a6bde..df4d2a19 100644
--- a/stc/clist.h
+++ b/stc/clist.h
@@ -133,8 +133,8 @@
} \
STC_INLINE void \
clist_##tag##_next(clist_##tag##_iter_t* it) { \
- if (it->item == *it->_last) it->end = it->item = it->item->next; \
- else it->item = it->item->next; \
+ it->end = it->item == *it->_last ? it->item->next : NULL; \
+ it->item = it->item->next; \
} \
\
STC_API clist_##tag##_iter_t \