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:
Finn Evers 2025-09-09 10:04:27 +02:00 committed by GitHub
parent 11d81b95d4
commit 365c5ab45f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8298,7 +8298,7 @@ impl Element for EditorElement {
let (mut snapshot, is_read_only) = self.editor.update(cx, |editor, 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 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()
})
.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)
.git
.inline_blame
@ -8793,7 +8793,7 @@ impl Element for EditorElement {
let longest_line_width = layout_line(
snapshot.longest_row(),
&snapshot,
&style,
style,
editor_width,
is_row_soft_wrapped,
window,
@ -8951,7 +8951,7 @@ impl Element for EditorElement {
scroll_pixel_position,
newest_selection_head,
editor_width,
&style,
style,
window,
cx,
)
@ -8969,7 +8969,7 @@ impl Element for EditorElement {
end_row,
line_height,
em_width,
&style,
style,
window,
cx,
);
@ -9114,7 +9114,7 @@ impl Element for EditorElement {
&line_layouts,
newest_selection_head,
newest_selection_point,
&style,
style,
window,
cx,
)