[cfe-commits] [clang-tools-extra] r171998 - /clang-tools-extra/trunk/clang-format/clang-format-diff.py

Daniel Jasper djasper at google.com
Wed Jan 9 12:46:42 PST 2013


Author: djasper
Date: Wed Jan  9 14:46:42 2013
New Revision: 171998

URL: http://llvm.org/viewvc/llvm-project?rev=171998&view=rev
Log:
Simplify reversed for-loop.

Modified:
    clang-tools-extra/trunk/clang-format/clang-format-diff.py

Modified: clang-tools-extra/trunk/clang-format/clang-format-diff.py
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/clang-format-diff.py?rev=171998&r1=171997&r2=171998&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-format/clang-format-diff.py (original)
+++ clang-tools-extra/trunk/clang-format/clang-format-diff.py Wed Jan  9 14:46:42 2013
@@ -106,10 +106,8 @@
       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)
 
 





More information about the cfe-commits mailing list