diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2016-06-13 15:09:05 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2016-06-13 15:16:10 (GMT) |
commit | ebf18df58083c90d4ba06ab896dfad8df9fe6ade (patch) | |
tree | 7ff77bcad7734b33e9eb21eb657ba9223f970222 /Source/cmFindPackageCommand.cxx | |
parent | d546456765072e6d4e6307eb6431de23f7bfe418 (diff) | |
download | CMake-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.cxx | 17 |
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 = ";"; } |