summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-10-31 17:06:58 +0100
committerTyge Løvset <[email protected]>2022-10-31 17:06:58 +0100
commit11fe640c0c21a1ba1cca677be7b2d602f0bff4a9 (patch)
tree45fda5602361e9d717e2d147be852eab7942022f
parentd4fb53311441be008fa5983adad72e151584c89a (diff)
downloadSTC-modified-11fe640c0c21a1ba1cca677be7b2d602f0bff4a9.tar.gz
STC-modified-11fe640c0c21a1ba1cca677be7b2d602f0bff4a9.zip
Anorter minor fix in clist_X_erase_range()
-rw-r--r--include/stc/clist.h4
1 files 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;
}