Avoid quadratic algorithm

This commit is contained in:
Kovid Goyal 2025-09-30 08:49:31 +05:30
parent 4122f029df
commit ec6910074f
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -268,9 +268,10 @@ def _startup(self, session_tab: SessionTab) -> None:
if window.focus_matching_window_spec:
# include windows from this tab when matching windows
all_windows = list(boss.all_windows)
all_windows.extend(w for w in self if w not in all_windows)
awq = {w.id for w in all_windows}
all_windows.extend(w for w in self if w.id not in awq)
for w in boss.match_windows(
window.focus_matching_window_spec, launched_window or boss.active_window, all_windows
window.focus_matching_window_spec, launched_window or boss.active_window, all_windows
):
tab = w.tabref()
if tab: