mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Remove extra hash-map lookup unregistering media controls
This commit is contained in:
parent
5aba6d5bbb
commit
f8ae394cad
1 changed files with 2 additions and 2 deletions
|
@ -2475,7 +2475,8 @@ 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>()
|
||||
|
@ -2483,7 +2484,6 @@ impl Document {
|
|||
} else {
|
||||
debug_assert!(false, "Trying to unregister unknown media controls");
|
||||
}
|
||||
self.media_controls.borrow_mut().remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue