diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-10-13 09:30:44 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-10-14 17:36:00 +0300 |
| commit | 79eef5ee907d2633ac2d4d1f1086b9a758328e01 (patch) | |
| tree | 0ddd1285d1836384e2a9c9a8f30397281b01da7f /src/layout/mod.rs | |
| parent | 29602ca995e349b47e65b6ef07f5cf47d6da8e5a (diff) | |
| download | niri-79eef5ee907d2633ac2d4d1f1086b9a758328e01.tar.gz niri-79eef5ee907d2633ac2d4d1f1086b9a758328e01.tar.bz2 niri-79eef5ee907d2633ac2d4d1f1086b9a758328e01.zip | |
layout: Remove unnecessary vec lookup
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 0a1063fb..89a89a83 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -753,10 +753,10 @@ impl<W: LayoutElement> Layout<W> { // Clean up empty workspaces that are not active and not last. if !ws.has_windows() + && ws.name.is_none() && idx != mon.active_workspace_idx && idx != mon.workspaces.len() - 1 && mon.workspace_switch.is_none() - && mon.workspaces[idx].name.is_none() { mon.workspaces.remove(idx); @@ -776,7 +776,7 @@ impl<W: LayoutElement> Layout<W> { let win = ws.remove_window(window, transaction); // Clean up empty workspaces. - if !ws.has_windows() && workspaces[idx].name.is_none() { + if !ws.has_windows() && ws.name.is_none() { workspaces.remove(idx); } |
