mirror of https://github.com/lapce/lapce.git
Remove unnecessary vector allocation in `TerminalPanel::update` (#1834)
This commit is contained in:
parent
10962a658d
commit
3c82433e7d
|
@ -231,13 +231,14 @@ fn update(
|
||||||
self.tabs.insert(*tab_id, WidgetPod::new(split));
|
self.tabs.insert(*tab_id, WidgetPod::new(split));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for tab_id in self.tabs.keys().copied().collect::<Vec<_>>() {
|
self.tabs.retain(|tab_id, _| {
|
||||||
if !data.terminal.tabs.contains_key(&tab_id) {
|
if !data.terminal.tabs.contains_key(tab_id) {
|
||||||
changed = true;
|
changed = true;
|
||||||
ctx.children_changed();
|
ctx.children_changed();
|
||||||
self.tabs.remove(&tab_id);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
true
|
||||||
|
});
|
||||||
if changed && !self.tabs.is_empty() {
|
if changed && !self.tabs.is_empty() {
|
||||||
ctx.submit_command(Command::new(
|
ctx.submit_command(Command::new(
|
||||||
LAPCE_UI_COMMAND,
|
LAPCE_UI_COMMAND,
|
||||||
|
|
Loading…
Reference in New Issue