diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-15 22:04:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-19 12:06:08 (GMT) |
commit | f43baf69814176f52b2b229667c4d3e88154bdea (patch) | |
tree | 58d8ff3131b492e71be8feb701a013e28f00dd9c /Source/CPack/WiX/cmWIXShortcut.cxx | |
parent | c0c5f924fe46fcf83603117689b372cb8520c4bb (diff) | |
download | CMake-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/WiX/cmWIXShortcut.cxx')
-rw-r--r-- | Source/CPack/WiX/cmWIXShortcut.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/CPack/WiX/cmWIXShortcut.cxx b/Source/CPack/WiX/cmWIXShortcut.cxx index e5dea94..cd1988a 100644 --- a/Source/CPack/WiX/cmWIXShortcut.cxx +++ b/Source/CPack/WiX/cmWIXShortcut.cxx @@ -47,10 +47,9 @@ bool cmWIXShortcuts::EmitShortcuts( return false; } - for (shortcut_id_map_t::const_iterator j = id_map.begin(); j != id_map.end(); - ++j) { - std::string const& id = j->first; - shortcut_list_t const& shortcutList = j->second; + for (auto const& j : id_map) { + std::string const& id = j.first; + shortcut_list_t const& shortcutList = j.second; for (size_t shortcutListIndex = 0; shortcutListIndex < shortcutList.size(); ++shortcutListIndex) { @@ -68,9 +67,8 @@ bool cmWIXShortcuts::EmitShortcuts( void cmWIXShortcuts::AddShortcutTypes(std::set<Type>& types) { - for (shortcut_type_map_t::const_iterator i = this->Shortcuts.begin(); - i != this->Shortcuts.end(); ++i) { - types.insert(i->first); + for (auto const& shortcut : this->Shortcuts) { + types.insert(shortcut.first); } } @@ -96,9 +94,9 @@ void cmWIXShortcuts::CreateFromProperty(std::string const& propertyName, std::vector<std::string> list; installedFile.GetPropertyAsList(propertyName, list); - for (size_t i = 0; i < list.size(); ++i) { + for (std::string const& label : list) { cmWIXShortcut shortcut; - shortcut.label = list[i]; + shortcut.label = label; shortcut.workingDirectoryId = directoryId; insert(type, id, shortcut); } |