Skip to content

Commit eea2f87

Browse files
Use a HashSet instead of Vec
1 parent 0347480 commit eea2f87

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,11 @@ pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
581581
}
582582
}
583583

584-
cx.active_extern_traits.borrow_mut().push(did);
584+
cx.active_extern_traits.borrow_mut().insert(did);
585585

586586
debug!("record_extern_trait: {:?}", did);
587587
let trait_ = build_external_trait(cx, did);
588588

589-
{
590-
cx.external_traits.borrow_mut().insert(did, trait_);
591-
}
592-
cx.active_extern_traits.borrow_mut().remove_item(&did);
589+
cx.external_traits.borrow_mut().insert(did, trait_);
590+
cx.active_extern_traits.borrow_mut().remove(&did);
593591
}

src/librustdoc/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct DocContext<'tcx> {
5151
pub external_traits: Rc<RefCell<FxHashMap<DefId, clean::Trait>>>,
5252
/// Used while populating `external_traits` to ensure we don't process the same trait twice at
5353
/// the same time.
54-
pub active_extern_traits: RefCell<Vec<DefId>>,
54+
pub active_extern_traits: RefCell<FxHashSet<DefId>>,
5555
// The current set of type and lifetime substitutions,
5656
// for expanding type aliases at the HIR level:
5757

0 commit comments

Comments
 (0)