summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-06-13 15:09:05 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2016-06-13 15:16:10 (GMT)
commitebf18df58083c90d4ba06ab896dfad8df9fe6ade (patch)
tree7ff77bcad7734b33e9eb21eb657ba9223f970222 /Source/cmFindPackageCommand.cxx
parentd546456765072e6d4e6307eb6431de23f7bfe418 (diff)
downloadCMake-ebf18df58083c90d4ba06ab896dfad8df9fe6ade.zip
CMake-ebf18df58083c90d4ba06ab896dfad8df9fe6ade.tar.gz
CMake-ebf18df58083c90d4ba06ab896dfad8df9fe6ade.tar.bz2
cmFindPackageCommand: use iterators to loop over configurations
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 7908afe..4ab7a72 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -670,10 +670,10 @@ bool cmFindPackageCommand::HandlePackageMode()
<< " requested version \"" << this->Version << "\".\n"
<< "The following configuration files were considered but not "
"accepted:\n";
- for (std::vector<ConfigFileInfo>::size_type i = 0;
- i < this->ConsideredConfigs.size(); i++) {
- e << " " << this->ConsideredConfigs[i].filename
- << ", version: " << this->ConsideredConfigs[i].version << "\n";
+ for (std::vector<ConfigFileInfo>::const_iterator i =
+ this->ConsideredConfigs.begin();
+ i != this->ConsideredConfigs.end(); ++i) {
+ e << " " << i->filename << ", version: " << i->version << "\n";
}
} else {
std::string requestedVersionString;
@@ -766,12 +766,13 @@ bool cmFindPackageCommand::HandlePackageMode()
std::string consideredVersions;
const char* sep = "";
- for (std::vector<ConfigFileInfo>::size_type i = 0;
- i < this->ConsideredConfigs.size(); i++) {
+ for (std::vector<ConfigFileInfo>::const_iterator i =
+ this->ConsideredConfigs.begin();
+ i != this->ConsideredConfigs.end(); ++i) {
consideredConfigFiles += sep;
consideredVersions += sep;
- consideredConfigFiles += this->ConsideredConfigs[i].filename;
- consideredVersions += this->ConsideredConfigs[i].version;
+ consideredConfigFiles += i->filename;
+ consideredVersions += i->version;
sep = ";";
}