From 501beee633698b34dc53435f45d7006282ce25ad Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 25 Jun 2015 01:19:21 +0100 Subject: [PATCH] in HashRange, keep p_beg always pointing to the same bucket as p_node --- octa/internal/hashtable.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/octa/internal/hashtable.h b/octa/internal/hashtable.h index e9af01b..8e797b5 100644 --- a/octa/internal/hashtable.h +++ b/octa/internal/hashtable.h @@ -54,10 +54,7 @@ private: void advance() { while ((p_beg != p_end) && !p_beg[0]) ++p_beg; - if (p_beg != p_end) { - p_node = p_beg[0]; - ++p_beg; - } + if (p_beg != p_end) p_node = p_beg[0]; } public: HashRange(): p_beg(), p_end(), p_node() {} @@ -89,6 +86,7 @@ public: if (!p_node) return false; p_node = p_node->next; if (p_node) return true; + ++p_beg; advance(); return true; }