From 2d60a59de997ac4dee03a2b16ac0660465bc4fd5 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 12 Jun 2007 09:27:40 +0000 Subject: [PATCH] slightly increase hashset iterator speed [r14425] --- ir/adt/hashset.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ir/adt/hashset.c b/ir/adt/hashset.c index 65e8e27f8..b3af299e9 100644 --- a/ir/adt/hashset.c +++ b/ir/adt/hashset.c @@ -580,19 +580,14 @@ ValueType hashset_iterator_next(HashSetIterator *self) HashSetEntry *current_bucket = self->current_bucket; HashSetEntry *end = self->end; - if(current_bucket >= end) - return NullValue; - /* using hashset_insert or hashset_remove is not allowed while iterating */ assert(self->entries_version == self->set->entries_version); do { current_bucket++; - } while(current_bucket < end && - (EntryIsEmpty(*current_bucket) || EntryIsDeleted(*current_bucket))); - - if(current_bucket >= end) - return NullValue; + if(current_bucket >= end) + return NullValue; + } while(EntryIsEmpty(*current_bucket) || EntryIsDeleted(*current_bucket)); self->current_bucket = current_bucket; return EntryGetValue(*current_bucket); -- 2.20.1