Skip to content

Commit

Permalink
Use a HashSet instead of Vec
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Aug 11, 2019
1 parent 0347480 commit eea2f87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/librustdoc/clean/inline.rs
Expand Up @@ -581,13 +581,11 @@ pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
}
}

cx.active_extern_traits.borrow_mut().push(did);
cx.active_extern_traits.borrow_mut().insert(did);

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

{
cx.external_traits.borrow_mut().insert(did, trait_);
}
cx.active_extern_traits.borrow_mut().remove_item(&did);
cx.external_traits.borrow_mut().insert(did, trait_);
cx.active_extern_traits.borrow_mut().remove(&did);
}
2 changes: 1 addition & 1 deletion src/librustdoc/core.rs
Expand Up @@ -51,7 +51,7 @@ pub struct DocContext<'tcx> {
pub external_traits: Rc<RefCell<FxHashMap<DefId, clean::Trait>>>,
/// Used while populating `external_traits` to ensure we don't process the same trait twice at
/// the same time.
pub active_extern_traits: RefCell<Vec<DefId>>,
pub active_extern_traits: RefCell<FxHashSet<DefId>>,
// The current set of type and lifetime substitutions,
// for expanding type aliases at the HIR level:

Expand Down

0 comments on commit eea2f87

Please sign in to comment.