diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 10:40:26 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 13:22:47 (GMT) |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmStringCommand.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | CMake-7d5095796ab616cf9b709036387bb95ab9984141.zip CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2 |
Meta: modernize old-fashioned loops to range-based `for`.
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r-- | Source/cmStringCommand.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 592f66e..3b6a7ee 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -412,13 +412,13 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) } // Concatenate the replacement for the match. - for (unsigned int i = 0; i < replacement.size(); ++i) { - if (replacement[i].number < 0) { + for (RegexReplacement const& i : replacement) { + if (i.number < 0) { // This is just a plain-text part of the replacement. - output += replacement[i].value; + output += i.value; } else { // Replace with part of the match. - int n = replacement[i].number; + int n = i.number; std::string::size_type start = re.start(n); std::string::size_type end = re.end(n); std::string::size_type len = input.length() - base; |