summaryrefslogtreecommitdiffhomepage
path: root/include/stc/clist.h
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-04-11 01:22:27 +0200
committerTyge Lovset <[email protected]>2022-04-11 01:22:27 +0200
commit5d1de359348733896b6d4448a465ce3b7d9d0684 (patch)
tree0cbb8f1155fbfa70878f0dd2c18664ada5066523 /include/stc/clist.h
parent99acd2149f3f8996249b3ef82f7490dd098783d7 (diff)
downloadSTC-modified-5d1de359348733896b6d4448a465ce3b7d9d0684.tar.gz
STC-modified-5d1de359348733896b6d4448a465ce3b7d9d0684.zip
Fixed an potential issue with c_eq in template.h and missing usage in clist.h
Diffstat (limited to 'include/stc/clist.h')
-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 0ff59967..6ac9c1cd 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -289,7 +289,7 @@ STC_DEF _cx_iter
_cx_memb(_find_in)(_cx_iter it1, _cx_iter it2, i_valraw val) {
c_foreach (it, _cx_self, it1, it2) {
i_valraw r = i_valto(it.ref);
- if (!(i_cmp((&r), (&val)))) return it;
+ if (i_eq((&r), (&val))) return it;
}
it2.ref = NULL; return it2;
}
@@ -301,7 +301,7 @@ _cx_memb(_remove)(_cx_self* self, i_valraw val) {
while (prev) {
node = prev->next;
i_valraw r = i_valto((&node->value));
- if (!(i_cmp((&r), (&val))))
+ if (i_eq((&r), (&val)))
prev = _cx_memb(_erase_after_)(self, prev), ++n;
else
prev = (node == self->last ? NULL : node);