summaryrefslogtreecommitdiffstats
path: root/Lib/difflib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-08-04 05:36:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2014-08-04 05:36:32 (GMT)
commitf25a38e5687df1c50cbc101c2528dbb81205e945 (patch)
tree0219c77ed41673ef988c3aa7591abf4ec3e8db1f /Lib/difflib.py
parent5427df266bb32970527a03a05af4f845a04b8f9e (diff)
downloadcpython-f25a38e5687df1c50cbc101c2528dbb81205e945.zip
cpython-f25a38e5687df1c50cbc101c2528dbb81205e945.tar.gz
cpython-f25a38e5687df1c50cbc101c2528dbb81205e945.tar.bz2
Use reversed() instead of creating a new temporary list.
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r--Lib/difflib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 4af88a9..f161baa 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -1410,7 +1410,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
change_re.sub(record_sub_info,markers)
# process each tuple inserting our special marks that won't be
# noticed by an xml/html escaper.
- for key,(begin,end) in sub_info[::-1]:
+ for key,(begin,end) in reversed(sub_info):
text = text[0:begin]+'\0'+key+text[begin:end]+'\1'+text[end:]
text = text[2:]
# Handle case of add/delete entire line