diff options
author | Brad King <brad.king@kitware.com> | 2019-02-11 13:08:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-11 13:08:22 (GMT) |
commit | 4b37b4f1bb785a305ab742f37e5268d4cffef693 (patch) | |
tree | f9c6e15ac0925bfa8b15fce4c3475d3233a820f6 /Source/CursesDialog | |
parent | 17de1eea806d7ba87a4ba6ad1073ced5f7ea9473 (diff) | |
parent | 01b2d6ab7465e7f22fb821876027df86b0c8f363 (diff) | |
download | CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.zip CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.gz CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.bz2 |
Merge topic 'modernize-for-loops'
01b2d6ab74 Modernize: Use ranged for-loops when possible
15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2901
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesLongMessageForm.cxx | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 17 |
2 files changed, 8 insertions, 14 deletions
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index a41d051..4e887d6 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -19,9 +19,8 @@ cmCursesLongMessageForm::cmCursesLongMessageForm( std::vector<std::string> const& messages, const char* title) { // Append all messages into on big string - std::vector<std::string>::const_iterator it; - for (it = messages.begin(); it != messages.end(); it++) { - this->Messages += (*it); + for (std::string const& message : messages) { + this->Messages += message; // Add one blank line after each message this->Messages += "\n\n"; } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index f6a1a57..076ee3d 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -107,10 +107,9 @@ void cmCursesMainForm::InitializeUI() // Count non-internal and non-static entries int count = 0; - for (std::vector<std::string>::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) { + for (std::string const& key : cacheKeys) { cmStateEnums::CacheEntryType t = - this->CMakeInstance->GetState()->GetCacheEntryType(*it); + this->CMakeInstance->GetState()->GetCacheEntryType(key); if (t != cmStateEnums::INTERNAL && t != cmStateEnums::STATIC && t != cmStateEnums::UNINITIALIZED) { ++count; @@ -130,11 +129,9 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for (std::vector<std::string>::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) { - std::string key = *it; + for (std::string const& key : cacheKeys) { cmStateEnums::CacheEntryType t = - this->CMakeInstance->GetState()->GetCacheEntryType(*it); + this->CMakeInstance->GetState()->GetCacheEntryType(key); if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC || t == cmStateEnums::UNINITIALIZED) { continue; @@ -148,11 +145,9 @@ void cmCursesMainForm::InitializeUI() } // then add entries which are old - for (std::vector<std::string>::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) { - std::string key = *it; + for (std::string const& key : cacheKeys) { cmStateEnums::CacheEntryType t = - this->CMakeInstance->GetState()->GetCacheEntryType(*it); + this->CMakeInstance->GetState()->GetCacheEntryType(key); if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC || t == cmStateEnums::UNINITIALIZED) { continue; |