From 11fe640c0c21a1ba1cca677be7b2d602f0bff4a9 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 31 Oct 2022 17:06:58 +0100 Subject: Anorter minor fix in clist_X_erase_range() --- include/stc/clist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stc/clist.h b/include/stc/clist.h index dc5afda4..82adcdf8 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -333,10 +333,10 @@ _cx_memb(_erase_at)(_cx_self* self, _cx_iter it) { STC_DEF _cx_iter _cx_memb(_erase_range)(_cx_self* self, _cx_iter it1, _cx_iter it2) { _cx_node *end = it2.ref ? _clist_tonode(it2.ref) : self->last->next; - if (it1.ref) while (it1.prev->next != end) { + if (it1.ref != it2.ref) do { _cx_memb(_erase_node_after)(self, it1.prev); if (!self->last) break; - } + } while (it1.prev->next != end); return it2; } -- cgit v1.2.3