Skip to content

Commit

Permalink
Auto merge of #10402 - mbrubeck:make_mut, r=pcwalton
Browse files Browse the repository at this point in the history
Avoid unnecessary Arc::clone and Arc::make_mut

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10402)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Apr 7, 2016
2 parents e66e437 + f713948 commit 39ab006
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/layout/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
block_flow));
let fragment = Fragment::from_opaque_node_and_style(node.opaque(),
node.get_pseudo_element_type().strip(),
modified_style.clone(),
modified_style,
node.selected_style().clone(),
node.restyle_damage(),
fragment_info);
Expand Down
12 changes: 12 additions & 0 deletions components/style/properties.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7017,6 +7017,18 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ServoComputedValues>
is_first_fragment_of_element: bool,
is_last_fragment_of_element: bool) {
fn modify_side(style: &mut Arc<ServoComputedValues>, side: PhysicalSide) {
{
let border = &style.border;
let current_style = match side {
PhysicalSide::Left => (border.border_left_width, border.border_left_style),
PhysicalSide::Right => (border.border_right_width, border.border_right_style),
PhysicalSide::Top => (border.border_top_width, border.border_top_style),
PhysicalSide::Bottom => (border.border_bottom_width, border.border_bottom_style),
};
if current_style == (Au(0), BorderStyle::none) {
return;
}
}
let mut style = Arc::make_mut(style);
let border = Arc::make_mut(&mut style.border);
match side {
Expand Down

0 comments on commit 39ab006

Please sign in to comment.