mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 05:42:03 +03:00
micro optimize clearing a line
Turns out to be faster to clear and then resize than it is to resize down and manually assign the elements
This commit is contained in:
parent
a022d3856a
commit
819bc247a0
@ -56,10 +56,8 @@ impl Line {
|
||||
|
||||
pub fn resize_and_clear(&mut self, width: usize) {
|
||||
let blank = Cell::default();
|
||||
self.cells.clear();
|
||||
self.cells.resize(width, blank);
|
||||
for cell in &mut self.cells {
|
||||
*cell = Cell::default();
|
||||
}
|
||||
self.bits = LineBits::DIRTY;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user