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/cmStateDirectory.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/cmStateDirectory.cxx')
-rw-r--r-- | Source/cmStateDirectory.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 46a1858..418f051 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -6,7 +6,6 @@ #include <algorithm> #include <assert.h> #include <iterator> -#include <map> #include <utility> #include "cmProperty.h" @@ -443,9 +442,8 @@ const char* cmStateDirectory::GetProperty(const std::string& prop, std::vector<std::string> child_dirs; std::vector<cmStateSnapshot> const& children = this->DirectoryState->Children; - for (std::vector<cmStateSnapshot>::const_iterator ci = children.begin(); - ci != children.end(); ++ci) { - child_dirs.push_back(ci->GetDirectory().GetCurrentSource()); + for (cmStateSnapshot const& ci : children) { + child_dirs.push_back(ci.GetDirectory().GetCurrentSource()); } output = cmJoin(child_dirs, ";"); return output.c_str(); @@ -514,10 +512,8 @@ std::vector<std::string> cmStateDirectory::GetPropertyKeys() const { std::vector<std::string> keys; keys.reserve(this->DirectoryState->Properties.size()); - for (cmPropertyMap::const_iterator it = - this->DirectoryState->Properties.begin(); - it != this->DirectoryState->Properties.end(); ++it) { - keys.push_back(it->first); + for (auto const& it : this->DirectoryState->Properties) { + keys.push_back(it.first); } return keys; } |