mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Use a match rather than a for loop for last_loaded_url in ScriptTask::load.
This commit is contained in:
parent
fbcfe78bf6
commit
1d464abb5a
1 changed files with 4 additions and 5 deletions
|
@ -920,17 +920,16 @@ impl ScriptTask {
|
|||
is a bug.");
|
||||
let page = page_tree.page();
|
||||
|
||||
let last_loaded_url = replace(&mut *page.mut_url(), None);
|
||||
for loaded in last_loaded_url.iter() {
|
||||
let (ref loaded, needs_reflow) = *loaded;
|
||||
if *loaded == url {
|
||||
match replace(&mut *page.mut_url(), None) {
|
||||
Some((ref loaded, needs_reflow)) if *loaded == url => {
|
||||
*page.mut_url() = Some((loaded.clone(), false));
|
||||
if needs_reflow {
|
||||
page.damage(ContentChangedDocumentDamage);
|
||||
page.reflow(ReflowForDisplay, self.chan.clone(), self.compositor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
|
||||
let cx = self.js_context.borrow();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue