summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-format/clang-format-diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-format/clang-format-diff.py')
-rwxr-xr-xclang-tools-extra/clang-format/clang-format-diff.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-format/clang-format-diff.py b/clang-tools-extra/clang-format/clang-format-diff.py
index cd01f93db4c..a22392b39f0 100755
--- a/clang-tools-extra/clang-format/clang-format-diff.py
+++ b/clang-tools-extra/clang-format/clang-format-diff.py
@@ -106,10 +106,8 @@ def main():
ranges.append((filename, int(match.group(1)), line_count))
# Reverse the ranges so that the reformatting does not influence file offsets.
- ranges.reverse()
-
- # Do the actual formatting.
- for r in ranges:
+ for r in reversed(ranges):
+ # Do the actual formatting.
formatRange(r, args.style)
OpenPOWER on IntegriCloud