diff --git a/kitty/layout.py b/kitty/layout.py index 1418e483e..bb2671b80 100644 --- a/kitty/layout.py +++ b/kitty/layout.py @@ -499,9 +499,6 @@ def create_layout_object_for(name, os_window_id, tab_id, margin_width, padding_w def evict_cached_layouts(tab_id): - remove = [] - for key in create_layout_object_for.cache: - if key[2] == tab_id: - remove.append(key) + remove = [key for key in create_layout_object_for.cache if key[2] == tab_id] for key in remove: del create_layout_object_for.cache[key]