mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
LibLine: Avoid unnecessary copies of style spans
This commit is contained in:
parent
d3a6512643
commit
c4a9afe31a
1 changed files with 4 additions and 4 deletions
|
@ -1409,11 +1409,11 @@ ErrorOr<void> Editor::refresh_display()
|
|||
}
|
||||
|
||||
auto apply_styles = [&, empty_styles = HashMap<u32, Style> {}](size_t i) -> ErrorOr<void> {
|
||||
auto ends = m_current_spans.m_spans_ending.get(i).value_or(empty_styles);
|
||||
auto starts = m_current_spans.m_spans_starting.get(i).value_or(empty_styles);
|
||||
auto& ends = m_current_spans.m_spans_ending.get(i).value_or<>(empty_styles);
|
||||
auto& starts = m_current_spans.m_spans_starting.get(i).value_or<>(empty_styles);
|
||||
|
||||
auto anchored_ends = m_current_spans.m_anchored_spans_ending.get(i).value_or(empty_styles);
|
||||
auto anchored_starts = m_current_spans.m_anchored_spans_starting.get(i).value_or(empty_styles);
|
||||
auto& anchored_ends = m_current_spans.m_anchored_spans_ending.get(i).value_or<>(empty_styles);
|
||||
auto& anchored_starts = m_current_spans.m_anchored_spans_starting.get(i).value_or<>(empty_styles);
|
||||
|
||||
if (ends.size() || anchored_ends.size()) {
|
||||
Style style;
|
||||
|
|
Loading…
Add table
Reference in a new issue