Fix error in c_struct_clean.py

All words were counted for each token in the file.
This commit is contained in:
Campbell Barton 2024-03-08 11:32:14 +11:00
parent 6f6a6ace39
commit 6dffc162c7
1 changed files with 6 additions and 6 deletions

View File

@ -62,12 +62,12 @@ def clean_structs(fn: str, data_src: str) -> Optional[str]:
if ty in Token.Comment: # type: ignore
continue
for w_match in re_words.finditer(data_src):
w = w_match.group(0)
try:
word_occurance[w] += 1
except KeyError:
word_occurance[w] = 1
for w_match in re_words.finditer(data_src):
w = w_match.group(0)
try:
word_occurance[w] += 1
except KeyError:
word_occurance[w] = 1
lines = data_src.splitlines(keepends=True)