summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackComponentGroup.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-15 22:04:51 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-19 12:06:08 (GMT)
commitf43baf69814176f52b2b229667c4d3e88154bdea (patch)
tree58d8ff3131b492e71be8feb701a013e28f00dd9c /Source/CPack/cmCPackComponentGroup.cxx
parentc0c5f924fe46fcf83603117689b372cb8520c4bb (diff)
downloadCMake-f43baf69814176f52b2b229667c4d3e88154bdea.zip
CMake-f43baf69814176f52b2b229667c4d3e88154bdea.tar.gz
CMake-f43baf69814176f52b2b229667c4d3e88154bdea.tar.bz2
Meta: modernize old-fashioned loops to range-based `for` (CPack).
Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
Diffstat (limited to 'Source/CPack/cmCPackComponentGroup.cxx')
-rw-r--r--Source/CPack/cmCPackComponentGroup.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx
index e39398a..f888a5f 100644
--- a/Source/CPack/cmCPackComponentGroup.cxx
+++ b/Source/CPack/cmCPackComponentGroup.cxx
@@ -5,7 +5,6 @@
#include "cmSystemTools.h"
#include <string>
-#include <vector>
unsigned long cmCPackComponent::GetInstalledSize(
const std::string& installDir) const
@@ -14,11 +13,10 @@ unsigned long cmCPackComponent::GetInstalledSize(
return this->TotalSize;
}
- std::vector<std::string>::const_iterator fileIt;
- for (fileIt = this->Files.begin(); fileIt != this->Files.end(); ++fileIt) {
+ for (std::string const& file : this->Files) {
std::string path = installDir;
path += '/';
- path += *fileIt;
+ path += file;
this->TotalSize += cmSystemTools::FileLength(path);
}