diff options
| author | Tyge Løvset <[email protected]> | 2023-02-24 17:15:24 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-24 17:15:24 +0100 |
| commit | 1a2143fbbda0805fdc9d3862e9c45cb0fc6a336f (patch) | |
| tree | 7c6a139207c7efaec414ad85dd4ea58a6f3b19b5 /include/stc/cdeq.h | |
| parent | dde5e3465c4198841fdba32dfaf2220c87bc6a94 (diff) | |
| download | STC-modified-1a2143fbbda0805fdc9d3862e9c45cb0fc6a336f.tar.gz STC-modified-1a2143fbbda0805fdc9d3862e9c45cb0fc6a336f.zip | |
Added eq function to cspan.
Final cleanup normalized var naming.
Diffstat (limited to 'include/stc/cdeq.h')
| -rw-r--r-- | include/stc/cdeq.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h index d435d1e3..c4f84a1b 100644 --- a/include/stc/cdeq.h +++ b/include/stc/cdeq.h @@ -196,12 +196,12 @@ _cx_memb(_get_mut)(_cx_self* self, _cx_raw raw) { return (_cx_value *) _cx_memb(_get)(self, raw); } STC_INLINE bool -_cx_memb(_eq)(const _cx_self* v1, const _cx_self* v2) { - if (v1->_len != v2->_len) return false; - _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) { + if (x->_len != y->_len) return false; + _cx_iter i = _cx_memb(_begin)(x), j = _cx_memb(_begin)(y); + for (; i.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 true; } |
