layout: Remove unnecessary vec lookup
Browse files at this commit79eef5ee907d2633ac2d4d1f1086b9a758328e01Parent: 29602ca1 changed file +2 -2
- src/layout/mod.rs +2 -2
src/layout/mod.rsmodified+2 -2
| @@ -753,10 +753,10 @@ impl<W: LayoutElement> Layout<W> { | |||
| 753 | 753 | ||
| 754 | // Clean up empty workspaces that are not active and not last. | 754 | // Clean up empty workspaces that are not active and not last. |
| 755 | if !ws.has_windows() | 755 | if !ws.has_windows() |
| 756 | + && ws.name.is_none() | ||
| 756 | && idx != mon.active_workspace_idx | 757 | && idx != mon.active_workspace_idx |
| 757 | && idx != mon.workspaces.len() - 1 | 758 | && idx != mon.workspaces.len() - 1 |
| 758 | && mon.workspace_switch.is_none() | 759 | && mon.workspace_switch.is_none() |
| 759 | - && mon.workspaces[idx].name.is_none() | ||
| 760 | { | 760 | { |
| 761 | mon.workspaces.remove(idx); | 761 | mon.workspaces.remove(idx); |
| 762 | 762 | ||
| @@ -776,7 +776,7 @@ impl<W: LayoutElement> Layout<W> { | |||
| 776 | let win = ws.remove_window(window, transaction); | 776 | let win = ws.remove_window(window, transaction); |
| 777 | 777 | ||
| 778 | // Clean up empty workspaces. | 778 | // Clean up empty workspaces. |
| 779 | - if !ws.has_windows() && workspaces[idx].name.is_none() { | 779 | + if !ws.has_windows() && ws.name.is_none() { |
| 780 | workspaces.remove(idx); | 780 | workspaces.remove(idx); |
| 781 | } | 781 | } |
| 782 | 782 | ||