From f7139484a28b86a55798f615b92b39b43185235b Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Mon, 4 Apr 2016 14:07:06 -0700 Subject: [PATCH] Avoid unnecessary make_mut in inline border drawing --- components/style/properties.mako.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index fe9d654e592..a731f74bcc8 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -7010,6 +7010,18 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc is_first_fragment_of_element: bool, is_last_fragment_of_element: bool) { fn modify_side(style: &mut Arc, 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 {