From 68f497c962a5c9468f78eed0a78d10b5bb1c3354 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 1 Nov 2016 11:25:15 -0700 Subject: Avoid an extra lookup when finding new whitelisted items to traverse --- src/ir/context.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ir/context.rs b/src/ir/context.rs index 7e824be1..6c56eefe 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -922,9 +922,8 @@ impl<'ctx, 'gen> Iterator for WhitelistedItemsIter<'ctx, 'gen> id.collect_types(self.ctx, &mut sub_types, &()); for id in sub_types { - if !self.seen.contains(&id) { + if self.seen.insert(id) { self.to_iterate.push(id); - self.seen.insert(id); } } -- cgit v1.2.3