diff options
author | tfarina <tfarina@chromium.org> | 2015-03-25 10:02:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-25 17:03:07 +0000 |
commit | b9cf968c8dd857a4f1d583e1bd716f32eede07e4 (patch) | |
tree | 48c36f18c8fda6e1eebe2589efab62a4fa45faad /tools/gn/err.cc | |
parent | 0392dbf51928648a36cd40128b4ac8c9fd574b87 (diff) | |
download | chromium_src-b9cf968c8dd857a4f1d583e1bd716f32eede07e4.zip chromium_src-b9cf968c8dd857a4f1d583e1bd716f32eede07e4.tar.gz chromium_src-b9cf968c8dd857a4f1d583e1bd716f32eede07e4.tar.bz2 |
tools/gn: Convert for loops to use the new range-based loops in C++11.
range-based loops is one of the C++11 allowed features. See
https://chromium-cpp.appspot.com/ and
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/hpzz4EqbVmc.
This patch was generated with the following command lines:
$ ninja -C out/Debug -t compdb cxx > out/Debug/compile_commands.json
$ cd out/Debug
$ find ../../tools/gn -name '*.cc' | xargs -n 16 -P 32 \
~/src/repos/llvm/build/bin/clang-modernize -loop-convert -p . -include \
tools/gn -format -style=Chromium
$ ninja gn gn_unittests
$ ./gn_unittests
BUG=None
TEST=gn && gn_unittests
R=brettw@chromium.org
Review URL: https://codereview.chromium.org/986113002
Cr-Commit-Position: refs/heads/master@{#322177}
Diffstat (limited to 'tools/gn/err.cc')
-rw-r--r-- | tools/gn/err.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/gn/err.cc b/tools/gn/err.cc index 6a9033d..319bfa8 100644 --- a/tools/gn/err.cc +++ b/tools/gn/err.cc @@ -64,8 +64,8 @@ void OutputHighlighedPosition(const Location& location, highlight[i] = ' '; // Highlight all the ranges on the line. - for (size_t i = 0; i < ranges.size(); i++) - FillRangeOnLine(ranges[i], location.line_number(), &highlight); + for (const auto& range : ranges) + FillRangeOnLine(range, location.line_number(), &highlight); // Allow the marker to be one past the end of the line for marking the end. highlight.push_back(' '); |