@@ -71,20 +71,15 @@ def _add_problem_to_tag_map(
71
71
problem_tags_map [problem_name ].append (tag_name )
72
72
73
73
74
- def _process_tag_reference (
75
- tags_data : dict , item : dict , tag_name : str , problem_tags_map : dict [str , list [str ]]
76
- ) -> None :
77
- # Recursively resolve tag references
74
+ def _process_tag_reference (item : dict , tag_name : str , problem_tags_map : dict [str , list [str ]]) -> None :
78
75
referenced_problems = find_problems_by_tag (item ["tag" ])
79
76
for problem_name in referenced_problems :
80
77
_add_problem_to_tag_map (problem_tags_map , problem_name , tag_name )
81
78
82
79
83
- def _process_tag_item (
84
- tags_data : dict , item : str | dict , tag_name : str , problem_tags_map : dict [str , list [str ]]
85
- ) -> None :
80
+ def _process_tag_item (item : str | dict , tag_name : str , problem_tags_map : dict [str , list [str ]]) -> None :
86
81
if isinstance (item , dict ) and "tag" in item :
87
- _process_tag_reference (tags_data , item , tag_name , problem_tags_map )
82
+ _process_tag_reference (item , tag_name , problem_tags_map )
88
83
elif isinstance (item , str ):
89
84
_add_problem_to_tag_map (problem_tags_map , item , tag_name )
90
85
@@ -100,7 +95,7 @@ def _build_problem_tags_cache() -> dict[str, list[str]]:
100
95
for tag_name , problems in tags_data .items ():
101
96
if isinstance (problems , list ):
102
97
for item in problems :
103
- _process_tag_item (tags_data , item , tag_name , problem_tags_map )
98
+ _process_tag_item (item , tag_name , problem_tags_map )
104
99
105
100
return problem_tags_map
106
101
except (ValueError , OSError , KeyError ):
0 commit comments