summaryrefslogtreecommitdiffhomepage
path: root/include/stc/clist.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-24 17:15:24 +0100
committerTyge Løvset <[email protected]>2023-02-24 17:15:24 +0100
commit1a2143fbbda0805fdc9d3862e9c45cb0fc6a336f (patch)
tree7c6a139207c7efaec414ad85dd4ea58a6f3b19b5 /include/stc/clist.h
parentdde5e3465c4198841fdba32dfaf2220c87bc6a94 (diff)
downloadSTC-modified-1a2143fbbda0805fdc9d3862e9c45cb0fc6a336f.tar.gz
STC-modified-1a2143fbbda0805fdc9d3862e9c45cb0fc6a336f.zip
Added eq function to cspan.
Final cleanup normalized var naming.
Diffstat (limited to 'include/stc/clist.h')
-rw-r--r--include/stc/clist.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h
index 1650714b..f8a21f40 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -207,13 +207,13 @@ _cx_memb(_get_mut)(_cx_self* self, _cx_raw val) {
}
STC_INLINE bool
-_cx_memb(_eq)(const _cx_self* v1, const _cx_self* v2) {
- _cx_iter i1 = _cx_memb(_begin)(v1), i2 = _cx_memb(_begin)(v2);
- for (; i1.ref && i2.ref; _cx_memb(_next)(&i1), _cx_memb(_next)(&i2)) {
- const _cx_raw rx = i_keyto(i1.ref), ry = i_keyto(i2.ref);
- if (!(i_eq((&rx), (&ry)))) return false;
+_cx_memb(_eq)(const _cx_self* x, const _cx_self* y) {
+ _cx_iter i = _cx_memb(_begin)(x), j = _cx_memb(_begin)(y);
+ for (; i.ref && j.ref; _cx_memb(_next)(&i), _cx_memb(_next)(&j)) {
+ const _cx_raw _rx = i_keyto(i.ref), _ry = i_keyto(j.ref);
+ if (!(i_eq((&_rx), (&_ry)))) return false;
}
- return !(i1.ref || i2.ref);
+ return !(i.ref || j.ref);
}
#endif
#ifndef i_no_cmp