summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-11 10:40:26 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-12 13:22:47 (GMT)
commit7d5095796ab616cf9b709036387bb95ab9984141 (patch)
treec010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmakemain.cxx
parent00975e926199eea21763470e2ab876246e36669a (diff)
downloadCMake-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/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index a60b2b2..09dcb6d 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -311,22 +311,20 @@ int do_cmake(int ac, char const* const* av)
if (list_cached || list_all_cached) {
std::cout << "-- Cache values" << std::endl;
std::vector<std::string> keys = cm.GetState()->GetCacheEntryKeys();
- for (std::vector<std::string>::const_iterator it = keys.begin();
- it != keys.end(); ++it) {
- cmStateEnums::CacheEntryType t = cm.GetState()->GetCacheEntryType(*it);
+ for (std::string const& k : keys) {
+ cmStateEnums::CacheEntryType t = cm.GetState()->GetCacheEntryType(k);
if (t != cmStateEnums::INTERNAL && t != cmStateEnums::STATIC &&
t != cmStateEnums::UNINITIALIZED) {
const char* advancedProp =
- cm.GetState()->GetCacheEntryProperty(*it, "ADVANCED");
+ cm.GetState()->GetCacheEntryProperty(k, "ADVANCED");
if (list_all_cached || !advancedProp) {
if (list_help) {
std::cout << "// "
- << cm.GetState()->GetCacheEntryProperty(*it,
- "HELPSTRING")
+ << cm.GetState()->GetCacheEntryProperty(k, "HELPSTRING")
<< std::endl;
}
- std::cout << *it << ":" << cmState::CacheEntryTypeToString(t) << "="
- << cm.GetState()->GetCacheEntryValue(*it) << std::endl;
+ std::cout << k << ":" << cmState::CacheEntryTypeToString(t) << "="
+ << cm.GetState()->GetCacheEntryValue(k) << std::endl;
if (list_help) {
std::cout << std::endl;
}