avoid incrementing iterator when not appropriate

By chance, this hasn't caused any problems yet.
This commit is contained in:
Soren I. Bjornstad 2022-03-16 12:33:20 -05:00
parent f0bd41f65a
commit 4875f7c1f5

View File

@ -453,6 +453,7 @@ def _privatize_line(line: str, replacement_table: Dict[str, str],
# as is needed for slice notation. # as is needed for slice notation.
if increment_iterator_by: if increment_iterator_by:
start_idx = iterator.send(increment_iterator_by) start_idx = iterator.send(increment_iterator_by)
increment_iterator_by = 0
else: else:
start_idx = next(iterator) start_idx = next(iterator)
end_idx = start_idx + len(replace_person) end_idx = start_idx + len(replace_person)