mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 15:04:36 +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