editor: Remove unnecessary clone (#37833)
The style is taken by reference everywhere, so no need to clone it at the start of every `prepaint`. Release Notes: - N/A
This commit is contained in:
@@ -8298,7 +8298,7 @@ impl Element for EditorElement {
|
|||||||
let (mut snapshot, is_read_only) = self.editor.update(cx, |editor, cx| {
|
let (mut snapshot, is_read_only) = self.editor.update(cx, |editor, cx| {
|
||||||
(editor.snapshot(window, cx), editor.read_only(cx))
|
(editor.snapshot(window, cx), editor.read_only(cx))
|
||||||
});
|
});
|
||||||
let style = self.style.clone();
|
let style = &self.style;
|
||||||
|
|
||||||
let rem_size = window.rem_size();
|
let rem_size = window.rem_size();
|
||||||
let font_id = window.text_system().resolve_font(&style.text.font());
|
let font_id = window.text_system().resolve_font(&style.text.font());
|
||||||
@@ -8773,7 +8773,7 @@ impl Element for EditorElement {
|
|||||||
blame.blame_for_rows(&[row_infos], cx).next()
|
blame.blame_for_rows(&[row_infos], cx).next()
|
||||||
})
|
})
|
||||||
.flatten()?;
|
.flatten()?;
|
||||||
let mut element = render_inline_blame_entry(blame_entry, &style, cx)?;
|
let mut element = render_inline_blame_entry(blame_entry, style, cx)?;
|
||||||
let inline_blame_padding = ProjectSettings::get_global(cx)
|
let inline_blame_padding = ProjectSettings::get_global(cx)
|
||||||
.git
|
.git
|
||||||
.inline_blame
|
.inline_blame
|
||||||
@@ -8793,7 +8793,7 @@ impl Element for EditorElement {
|
|||||||
let longest_line_width = layout_line(
|
let longest_line_width = layout_line(
|
||||||
snapshot.longest_row(),
|
snapshot.longest_row(),
|
||||||
&snapshot,
|
&snapshot,
|
||||||
&style,
|
style,
|
||||||
editor_width,
|
editor_width,
|
||||||
is_row_soft_wrapped,
|
is_row_soft_wrapped,
|
||||||
window,
|
window,
|
||||||
@@ -8951,7 +8951,7 @@ impl Element for EditorElement {
|
|||||||
scroll_pixel_position,
|
scroll_pixel_position,
|
||||||
newest_selection_head,
|
newest_selection_head,
|
||||||
editor_width,
|
editor_width,
|
||||||
&style,
|
style,
|
||||||
window,
|
window,
|
||||||
cx,
|
cx,
|
||||||
)
|
)
|
||||||
@@ -8969,7 +8969,7 @@ impl Element for EditorElement {
|
|||||||
end_row,
|
end_row,
|
||||||
line_height,
|
line_height,
|
||||||
em_width,
|
em_width,
|
||||||
&style,
|
style,
|
||||||
window,
|
window,
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
@@ -9114,7 +9114,7 @@ impl Element for EditorElement {
|
|||||||
&line_layouts,
|
&line_layouts,
|
||||||
newest_selection_head,
|
newest_selection_head,
|
||||||
newest_selection_point,
|
newest_selection_point,
|
||||||
&style,
|
style,
|
||||||
window,
|
window,
|
||||||
cx,
|
cx,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user