File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class TagSortDirection(Flag):
34
34
def normalize_sort (old_sort : Sort = None ) -> Sort :
35
35
if old_sort is None :
36
36
old_sort = []
37
- old_sort .extend (_default_sort )
37
+ old_sort .extend (_default_sort . copy () )
38
38
39
39
sorted_properties : set [TagSortProperty ] = set ()
40
40
new_sort = []
@@ -72,8 +72,11 @@ def reverse_sort(old_sort: Sort) -> Sort:
72
72
73
73
74
74
def get_key (
75
- lib : Library , tag_id_list , sort : Sort = _default_sort
75
+ lib : Library , tag_id_list , sort : Sort = None
76
76
) -> Callable [[int ], list [Any ]]:
77
+ if sort is None :
78
+ sort = _default_sort .copy ()
79
+
77
80
sort = normalize_sort (sort )
78
81
79
82
outer_sort : Sort = []
@@ -177,9 +180,12 @@ def _get_canonical_lineage(
177
180
inner_sort : Sort ,
178
181
tag_id : int ,
179
182
tag_id_list : list [int ],
180
- last_generation_ids = set ([ - 1 ]) ,
183
+ last_generation_ids = None ,
181
184
first_gen = True ,
182
185
) -> list [list [Any ]]:
186
+ if first_gen :
187
+ last_generation_ids = set ([- 1 ])
188
+
183
189
ancestor_id_queue : list [int ] = [tag_id ]
184
190
encountered_tag_ids : set [int ] = set (last_generation_ids )
185
191
encountered_tag_ids .add (tag_id )
You can’t perform that action at this time.
0 commit comments