diff options
| author | Tyge Løvset <[email protected]> | 2021-09-08 10:24:45 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-09-08 10:24:45 +0200 |
| commit | 74a737adf39cf6416195dc9a9c83fd46362416a6 (patch) | |
| tree | 46b7048f60017eb72442dbf4d9073d53246431a6 /include/stc/cmap.h | |
| parent | c40cb13574d0b00da2ff151de81b701e29b80e10 (diff) | |
| download | STC-modified-74a737adf39cf6416195dc9a9c83fd46362416a6.tar.gz STC-modified-74a737adf39cf6416195dc9a9c83fd46362416a6.zip | |
Improved undocumented iterator method names: fwd, adv => advance, idx => index.
Diffstat (limited to 'include/stc/cmap.h')
| -rw-r--r-- | include/stc/cmap.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/stc/cmap.h b/include/stc/cmap.h index 943c883a..e2f277ee 100644 --- a/include/stc/cmap.h +++ b/include/stc/cmap.h @@ -215,7 +215,14 @@ cx_memb(_end)(const Self* self) STC_INLINE void
cx_memb(_next)(cx_iter_t* it)
- {while ((++it->ref, *++it->_hx == 0)) ; }
+ { while ((++it->ref, *++it->_hx == 0)) ; }
+
+STC_INLINE cx_iter_t
+cx_memb(_advance)(cx_iter_t it, size_t n) {
+ // UB if n > elements left
+ while (n--) cx_memb(_next)(&it);
+ return it;
+}
STC_INLINE size_t
cx_memb(_erase)(Self* self, i_keyraw rkey) {
|
