summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmWIXPatch.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-19 13:07:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-19 13:07:48 (GMT)
commit4547d9a83030f8ae7e636cef16a261c65e6feb40 (patch)
tree3b695694b889d506c61d010102e3824e89e39581 /Source/CPack/WiX/cmWIXPatch.cxx
parent7c28081c147e2eb6c7ad6dee0aada77219af7a6d (diff)
parentf43baf69814176f52b2b229667c4d3e88154bdea (diff)
downloadCMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.zip
CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.tar.gz
CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.tar.bz2
Merge topic 'ranged-for'
f43baf69 Meta: modernize old-fashioned loops to range-based `for` (CPack). Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1274
Diffstat (limited to 'Source/CPack/WiX/cmWIXPatch.cxx')
-rw-r--r--Source/CPack/WiX/cmWIXPatch.cxx23
1 files changed, 7 insertions, 16 deletions
diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx
index 287a644..dec95fb 100644
--- a/Source/CPack/WiX/cmWIXPatch.cxx
+++ b/Source/CPack/WiX/cmWIXPatch.cxx
@@ -29,10 +29,8 @@ void cmWIXPatch::ApplyFragment(std::string const& id,
return;
const cmWIXPatchElement& fragment = i->second;
- for (cmWIXPatchElement::attributes_t::const_iterator attr_i =
- fragment.attributes.begin();
- attr_i != fragment.attributes.end(); ++attr_i) {
- writer.AddAttribute(attr_i->first, attr_i->second);
+ for (auto const& attr : fragment.attributes) {
+ writer.AddAttribute(attr.first, attr.second);
}
this->ApplyElementChildren(fragment, writer);
@@ -42,11 +40,7 @@ void cmWIXPatch::ApplyFragment(std::string const& id,
void cmWIXPatch::ApplyElementChildren(const cmWIXPatchElement& element,
cmWIXSourceWriter& writer)
{
- for (cmWIXPatchElement::child_list_t::const_iterator j =
- element.children.begin();
- j != element.children.end(); ++j) {
- cmWIXPatchNode* node = *j;
-
+ for (cmWIXPatchNode* node : element.children) {
switch (node->type()) {
case cmWIXPatchNode::ELEMENT:
ApplyElement(dynamic_cast<const cmWIXPatchElement&>(*node), writer);
@@ -63,10 +57,8 @@ void cmWIXPatch::ApplyElement(const cmWIXPatchElement& element,
{
writer.BeginElement(element.name);
- for (cmWIXPatchElement::attributes_t::const_iterator i =
- element.attributes.begin();
- i != element.attributes.end(); ++i) {
- writer.AddAttribute(i->first, i->second);
+ for (auto const& attr : element.attributes) {
+ writer.AddAttribute(attr.first, attr.second);
}
this->ApplyElementChildren(element, writer);
@@ -77,14 +69,13 @@ void cmWIXPatch::ApplyElement(const cmWIXPatchElement& element,
bool cmWIXPatch::CheckForUnappliedFragments()
{
std::string fragmentList;
- for (cmWIXPatchParser::fragment_map_t::const_iterator i = Fragments.begin();
- i != Fragments.end(); ++i) {
+ for (auto const& fragment : Fragments) {
if (!fragmentList.empty()) {
fragmentList += ", ";
}
fragmentList += "'";
- fragmentList += i->first;
+ fragmentList += fragment.first;
fragmentList += "'";
}