refactor(readme_parser): consolidate state reset to tail of flush_group

State reset (current_group_name = None, current_group_cats = []) was
duplicated in both branches of the early-return guard. Move it after
the conditional so it runs exactly once regardless of path.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-04-19 21:54:16 +08:00
parent b897676e01
commit e47d229528
+1 -4
View File
@@ -324,10 +324,7 @@ def _parse_grouped_sections(
def flush_group() -> None:
nonlocal current_group_name, current_group_cats
if not current_group_cats:
current_group_name = None
current_group_cats = []
return
if current_group_cats:
name = current_group_name or "Other"
groups.append(ParsedGroup(
name=name,