summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-17 11:03:13 +0200
committerTyge Løvset <[email protected]>2022-08-17 11:03:13 +0200
commit2f4993a174c943c46d4da989e3c8acee560e1eb7 (patch)
treeae7d1c6682bdbf566462f7e31f2d6f9ff63d14af /include
parent3b41222609e3f54d4ada55e08f1fc9a7446189f1 (diff)
downloadSTC-modified-2f4993a174c943c46d4da989e3c8acee560e1eb7.tar.gz
STC-modified-2f4993a174c943c46d4da989e3c8acee560e1eb7.zip
reverted parts of last commit. No need to specify .end var in cmap_X_end() func.
Diffstat (limited to 'include')
-rw-r--r--include/stc/cmap.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/stc/cmap.h b/include/stc/cmap.h
index d62dbe64..b88e2722 100644
--- a/include/stc/cmap.h
+++ b/include/stc/cmap.h
@@ -200,7 +200,7 @@ _cx_memb(_begin)(const _cx_self* self) {
STC_INLINE _cx_iter
_cx_memb(_end)(const _cx_self* self)
- { return c_make(_cx_iter){NULL, self->table + self->bucket_count}; }
+ { return c_make(_cx_iter){NULL}; }
STC_INLINE void
_cx_memb(_next)(_cx_iter* it) {
@@ -217,10 +217,11 @@ _cx_memb(_advance)(_cx_iter it, size_t n) {
STC_INLINE _cx_iter
_cx_memb(_find)(const _cx_self* self, _cx_rawkey rkey) {
i_size idx;
- _cx_value* end = self->table + self->bucket_count;
if (self->size && self->_hashx[idx = _cx_memb(_bucket_)(self, &rkey).idx])
- return c_make(_cx_iter){self->table + idx, end, self->_hashx + idx};
- return c_make(_cx_iter){NULL, end};
+ return c_make(_cx_iter){self->table + idx,
+ self->table + self->bucket_count,
+ self->_hashx + idx};
+ return _cx_memb(_end)(self);
}
STC_INLINE const _cx_value*