Skip to content

Commit ec69100

Browse files
committed
Avoid quadratic algorithm
1 parent 4122f02 commit ec69100

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kitty/tabs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,10 @@ def _startup(self, session_tab: SessionTab) -> None:
268268
if window.focus_matching_window_spec:
269269
# include windows from this tab when matching windows
270270
all_windows = list(boss.all_windows)
271-
all_windows.extend(w for w in self if w not in all_windows)
271+
awq = {w.id for w in all_windows}
272+
all_windows.extend(w for w in self if w.id not in awq)
272273
for w in boss.match_windows(
273-
window.focus_matching_window_spec, launched_window or boss.active_window, all_windows
274+
window.focus_matching_window_spec, launched_window or boss.active_window, all_windows
274275
):
275276
tab = w.tabref()
276277
if tab:

0 commit comments

Comments
 (0)