summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2017-12-21 16:51:28 (GMT)
committerBrad King <brad.king@kitware.com>2017-12-21 19:52:49 (GMT)
commit92c7b5260795153f4152e8562a7abac3d6d77d8a (patch)
tree1b058a2162fd352df824a8c470f5c4b222531f71 /Source/cmLocalVisualStudioGenerator.cxx
parent258e6f1b1e1d20bc48a5892f5d9d339269fa2704 (diff)
downloadCMake-92c7b5260795153f4152e8562a7abac3d6d77d8a.zip
CMake-92c7b5260795153f4152e8562a7abac3d6d77d8a.tar.gz
CMake-92c7b5260795153f4152e8562a7abac3d6d77d8a.tar.bz2
VS: Use range-based 'for' loops in generator code
Use `auto` for complex types.
Diffstat (limited to 'Source/cmLocalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index bbb91e0..2237da7 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -39,10 +39,8 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
// windows file names are not case sensitive.
std::map<std::string, int> counts;
- for (std::map<cmSourceFile const*, std::string>::iterator si =
- mapping.begin();
- si != mapping.end(); ++si) {
- cmSourceFile const* sf = si->first;
+ for (auto const& si : mapping) {
+ cmSourceFile const* sf = si.first;
std::string objectNameLower = cmSystemTools::LowerCase(
cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
if (custom_ext) {
@@ -57,10 +55,8 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
// For all source files producing duplicate names we need unique
// object name computation.
- for (std::map<cmSourceFile const*, std::string>::iterator si =
- mapping.begin();
- si != mapping.end(); ++si) {
- cmSourceFile const* sf = si->first;
+ for (auto& si : mapping) {
+ cmSourceFile const* sf = si.first;
std::string objectName =
cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
if (custom_ext) {
@@ -74,7 +70,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
objectName = this->GetObjectFileNameWithoutTarget(
*sf, dir_max, &keptSourceExtension, custom_ext);
}
- si->second = objectName;
+ si.second = objectName;
}
}