mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-28 12:42:09 +03:00
Don't calculate symbol width twice
This is potentially costly so we should avoid calling width()
This commit is contained in:
parent
66a8612351
commit
ac81b47a41
@ -535,9 +535,10 @@ impl Buffer {
|
|||||||
updates.push((x, y, &next_buffer[i]));
|
updates.push((x, y, &next_buffer[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
to_skip = current.symbol.width().saturating_sub(1);
|
let current_width = current.symbol.width();
|
||||||
|
to_skip = current_width.saturating_sub(1);
|
||||||
|
|
||||||
let affected_width = std::cmp::max(current.symbol.width(), previous.symbol.width());
|
let affected_width = std::cmp::max(current_width, previous.symbol.width());
|
||||||
invalidated = std::cmp::max(affected_width, invalidated).saturating_sub(1);
|
invalidated = std::cmp::max(affected_width, invalidated).saturating_sub(1);
|
||||||
}
|
}
|
||||||
updates
|
updates
|
||||||
|
Loading…
Reference in New Issue
Block a user