Skip to content

Commit 68f497c

Browse files
committed
Avoid an extra lookup when finding new whitelisted items to traverse
1 parent 5691cab commit 68f497c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ir/context.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,8 @@ impl<'ctx, 'gen> Iterator for WhitelistedItemsIter<'ctx, 'gen>
922922
id.collect_types(self.ctx, &mut sub_types, &());
923923

924924
for id in sub_types {
925-
if !self.seen.contains(&id) {
925+
if self.seen.insert(id) {
926926
self.to_iterate.push(id);
927-
self.seen.insert(id);
928927
}
929928
}
930929

0 commit comments

Comments
 (0)