Skip to content

Commit 7bd912c

Browse files
committed
Micro optimization using the new ability to specify all_set
1 parent 46537e7 commit 7bd912c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

kitty/tabs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,17 +1153,16 @@ def next_tab(self, delta: int = 1) -> None:
11531153
self.set_active_tab_idx((self.active_tab_idx + len(self.tabs) + delta) % len(self.tabs))
11541154

11551155
def toggle_tab(self, match_expression: str) -> None:
1156-
tabs = set(get_boss().match_tabs(match_expression)) & set(self)
1156+
tabs = set(get_boss().match_tabs(match_expression, all_tabs=self))
11571157
if not tabs:
11581158
get_boss().show_error(_('No matching tab'), _('No tab found matching the expression: {}').format(match_expression))
11591159
return
11601160
if self.active_tab and self.active_tab in tabs:
11611161
self.goto_tab(-1)
11621162
else:
1163-
for x in self:
1164-
if x in tabs:
1165-
self.set_active_tab(x)
1166-
break
1163+
for x in tabs:
1164+
self.set_active_tab(x)
1165+
break
11671166

11681167
def tab_at_location(self, loc: str) -> Tab | None:
11691168
if loc == 'prev':

0 commit comments

Comments
 (0)