Skip to content

Commit ff53d7a

Browse files
author
bors-servo
authored
Auto merge of rust-lang#185 - fitzgen:whitelisted-items, r=emilio
Avoid an extra lookup when finding new whitelisted items to traverse `insert()` returns `true` if the item was *not* in the set before, so we can use that to avoid a double lookup. r? @emilio
2 parents b097751 + 68f497c commit ff53d7a

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)