From 66d674ac414ff52f8a399aec15b4b67d58ce07ad Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sun, 12 May 2019 18:25:33 -0400 Subject: [PATCH] [whitespace] ck_hs: style conformance from latest patches. --- src/ck_hs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ck_hs.c b/src/ck_hs.c index a7e15ea..246bceb 100644 --- a/src/ck_hs.c +++ b/src/ck_hs.c @@ -106,9 +106,11 @@ ck_hs_map_signal(struct ck_hs_map *map, unsigned long h) } static bool -_ck_hs_next(struct ck_hs *hs, struct ck_hs_map *map, struct ck_hs_iterator *i, void **key) +_ck_hs_next(struct ck_hs *hs, struct ck_hs_map *map, + struct ck_hs_iterator *i, void **key) { void *value; + if (i->offset >= map->capacity) return false; @@ -143,6 +145,7 @@ ck_hs_iterator_init(struct ck_hs_iterator *iterator) bool ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) { + return _ck_hs_next(hs, hs->map, i, key); } @@ -150,9 +153,11 @@ bool ck_hs_next_spmc(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) { struct ck_hs_map *m = i->map; + if (m == NULL) { m = i->map = ck_pr_load_ptr(&hs->map); } + return _ck_hs_next(hs, m, i, key); }