Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f25a38e

Browse files
committed
Use reversed() instead of creating a new temporary list.
1 parent 5427df2 commit f25a38e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/difflib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ def record_sub_info(match_object,sub_info=sub_info):
14101410
change_re.sub(record_sub_info,markers)
14111411
# process each tuple inserting our special marks that won't be
14121412
# noticed by an xml/html escaper.
1413-
for key,(begin,end) in sub_info[::-1]:
1413+
for key,(begin,end) in reversed(sub_info):
14141414
text = text[0:begin]+'\0'+key+text[begin:end]+'\1'+text[end:]
14151415
text = text[2:]
14161416
# Handle case of add/delete entire line

0 commit comments

Comments
 (0)