mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Reduce the scope of the unsafe block in ParallelPostorderDomTraversal.
This commit is contained in:
parent
b98a7f27a9
commit
b6e5f8e7b6
1 changed files with 14 additions and 15 deletions
|
@ -186,22 +186,21 @@ trait ParallelPostorderDomTraversal : PostorderDomTraversal {
|
|||
Some(parent) => parent,
|
||||
};
|
||||
|
||||
unsafe {
|
||||
let parent_layout_data =
|
||||
(*parent.borrow_layout_data_unchecked()).as_ref().expect("no layout data");
|
||||
let parent_layout_data = unsafe {
|
||||
&*parent.borrow_layout_data_unchecked()
|
||||
};
|
||||
let parent_layout_data = parent_layout_data.as_ref().expect("no layout data");
|
||||
unsafe_node = layout_node_to_unsafe_layout_node(&parent);
|
||||
|
||||
unsafe_node = layout_node_to_unsafe_layout_node(&parent);
|
||||
|
||||
if parent_layout_data
|
||||
.data
|
||||
.parallel
|
||||
.children_count
|
||||
.fetch_sub(1, Ordering::Relaxed) == 1 {
|
||||
// We were the last child of our parent. Construct flows for our parent.
|
||||
} else {
|
||||
// Get out of here and find another node to work on.
|
||||
break
|
||||
}
|
||||
if parent_layout_data
|
||||
.data
|
||||
.parallel
|
||||
.children_count
|
||||
.fetch_sub(1, Ordering::Relaxed) == 1 {
|
||||
// We were the last child of our parent. Construct flows for our parent.
|
||||
} else {
|
||||
// Get out of here and find another node to work on.
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue