From 2f4993a174c943c46d4da989e3c8acee560e1eb7 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 17 Aug 2022 11:03:13 +0200 Subject: reverted parts of last commit. No need to specify .end var in cmap_X_end() func. --- include/stc/cmap.h | 9 +++++---- 1 file 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* -- cgit v1.2.3