Skip to content

Commit a805f3f

Browse files
committed
1.8
1 parent a23076b commit a805f3f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

WorldTranslationExtractor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ def sub_replace(pattern: re.Pattern, string: str, repl, dupe=False, search_all=T
5858
if search_all:
5959
loop_count = 0
6060
last_match = None
61-
last_pos = 0
62-
match = pattern.search(string, last_pos)
61+
match = pattern.search(string)
6362
# can delete the 2 lines below
6463
if match is None:
6564
return string
@@ -70,8 +69,7 @@ def sub_replace(pattern: re.Pattern, string: str, repl, dupe=False, search_all=T
7069
raise Exception(f"TOO MANY COMPONENTS HERE: {string}")
7170
span = match.span()
7271
ls[span[0]:span[1]] = repl(match, dupe=dupe)
73-
last_pos = span[1]
74-
match = pattern.search(''.join(ls), last_pos)
72+
match = pattern.search(''.join(ls))
7573
last_match = match
7674
return ''.join(ls)
7775
else:

0 commit comments

Comments
 (0)