Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Simplify tab group lookup logic in SystemWindowTabController (#40466)

Xiaobo Liu8d48f9cdae65
diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs
index 07ff04e32ab..789652b331c 100644
--- a/crates/gpui/src/app.rs
+++ b/crates/gpui/src/app.rs
@@ -344,13 +344,9 @@ impl SystemWindowTabController {
let tab_group = self
.tab_groups
.iter()
- .find_map(|(group, tabs)| tabs.iter().find(|tab| tab.id == id).map(|_| *group));
+ .find_map(|(group, tabs)| tabs.iter().find(|tab| tab.id == id).map(|_| *group))?;
- if let Some(tab_group) = tab_group {
- self.tab_groups.get(&tab_group)
- } else {
- None
- }
+ self.tab_groups.get(&tab_group)
}
/// Initialize the visibility of the system window tab controller.