Skip to content

Commit

Permalink
Remove extra hash-map lookup unregistering media controls
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Jul 22, 2019
1 parent 5aba6d5 commit f8ae394
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/document.rs
Expand Up @@ -2475,15 +2475,15 @@ impl Document {
}

pub fn unregister_media_controls(&self, id: &str) {
if let Some(media_controls) = self.media_controls.borrow().get(id) {
if let Some(ref media_controls) = self.media_controls.borrow_mut().remove(id) {
let media_controls = DomRoot::from_ref(&**media_controls);
media_controls.Host().detach_shadow();
media_controls
.upcast::<Node>()
.dirty(NodeDamage::OtherNodeDamage);
} else {
debug_assert!(false, "Trying to unregister unknown media controls");
}
self.media_controls.borrow_mut().remove(id);
}
}

Expand Down

0 comments on commit f8ae394

Please sign in to comment.