Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
2d60a59d
Commit
2d60a59d
authored
Jun 12, 2007
by
Matthias Braun
Browse files
slightly increase hashset iterator speed
[r14425]
parent
834a425a
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/adt/hashset.c
View file @
2d60a59d
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment