Commit 2d60a59d authored by Matthias Braun's avatar Matthias Braun
Browse files

slightly increase hashset iterator speed

[r14425]
parent 834a425a
...@@ -580,19 +580,14 @@ ValueType hashset_iterator_next(HashSetIterator *self) ...@@ -580,19 +580,14 @@ ValueType hashset_iterator_next(HashSetIterator *self)
HashSetEntry *current_bucket = self->current_bucket; HashSetEntry *current_bucket = self->current_bucket;
HashSetEntry *end = self->end; HashSetEntry *end = self->end;
if(current_bucket >= end)
return NullValue;
/* using hashset_insert or hashset_remove is not allowed while iterating */ /* using hashset_insert or hashset_remove is not allowed while iterating */
assert(self->entries_version == self->set->entries_version); assert(self->entries_version == self->set->entries_version);
do { do {
current_bucket++; current_bucket++;
} while(current_bucket < end && if(current_bucket >= end)
(EntryIsEmpty(*current_bucket) || EntryIsDeleted(*current_bucket))); return NullValue;
} while(EntryIsEmpty(*current_bucket) || EntryIsDeleted(*current_bucket));
if(current_bucket >= end)
return NullValue;
self->current_bucket = current_bucket; self->current_bucket = current_bucket;
return EntryGetValue(*current_bucket); return EntryGetValue(*current_bucket);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment