aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments/paludis
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-08-04 21:57:23 -0700
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-08-04 22:11:01 -0700
commitf3cd2455110fad09158275287cbdaa67cc3e15c3 (patch)
treeb1922ea17b1401f0e86c6e3cdaf3a278dade4557 /paludis/environments/paludis
parente9ccc3a086f57507712a44ef2fadc34affa13af9 (diff)
downloadpaludis-f3cd2455110fad09158275287cbdaa67cc3e15c3.tar.gz
paludis-f3cd2455110fad09158275287cbdaa67cc3e15c3.tar.xz
modernize: convert to range based for-loops
Automated conversion to range based for loops. NFC
Diffstat (limited to 'paludis/environments/paludis')
-rw-r--r--paludis/environments/paludis/keywords_conf.cc21
-rw-r--r--paludis/environments/paludis/licenses_conf.cc35
-rw-r--r--paludis/environments/paludis/paludis_environment.cc9
-rw-r--r--paludis/environments/paludis/suggestions_conf.cc43
4 files changed, 48 insertions, 60 deletions
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 2b8c786f6..defcb97f6 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -145,22 +145,20 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::
SpecificMap::const_iterator i(_imp->qualified.find(e->name()));
if (i != _imp->qualified.end())
{
- for (PDSToKeywordsList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
- j != j_end ; ++j)
+ for (const auto & j : i->second)
{
- if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
+ if (! match_package(*_imp->env, *j.first, e, nullptr, { }))
continue;
- for (KeywordsList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j.second)
{
- if (*l == star_keyword)
+ if (l == star_keyword)
return true;
- else if (*l == minus_star_keyword)
+ else if (l == minus_star_keyword)
break_when_done = true;
- else if (k->end() != k->find(*l))
+ else if (k->end() != k->find(l))
return true;
}
}
@@ -217,13 +215,12 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::
if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
continue;
- for (KeywordsList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j->second)
{
- if (k->end() != k->find(*l))
+ if (k->end() != k->find(l))
return true;
- if (*l == star_keyword)
+ if (l == star_keyword)
return true;
}
}
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 7da32f1d2..0d6bfba97 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -139,20 +139,19 @@ namespace
void expand(const Environment * const env, LicensesList & list)
{
LicensesList extras;
- for (auto i(list.begin()), i_end(list.end()) ;
- i != i_end ; ++i)
+ for (auto & i : list)
{
- std::string s(*i);
+ std::string s(i);
if (0 == s.compare(0, 1, "-", 0, 1))
{
- auto l(env->expand_licence(i->substr(1)));
+ auto l(env->expand_licence(i.substr(1)));
for (auto v(l->begin()), v_end(l->end()) ;
v != v_end ; ++v)
extras.push_back("-" + *v);
}
else
{
- auto l(env->expand_licence(*i));
+ auto l(env->expand_licence(i));
for (auto v(l->begin()), v_end(l->end()) ;
v != v_end ; ++v)
extras.push_back(*v);
@@ -175,9 +174,8 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
for (auto q(_imp->qualified.begin()), q_end(_imp->qualified.end()) ;
q != q_end ; ++q)
{
- for (auto p(q->second.begin()), p_end(q->second.end()) ;
- p != p_end ; ++p)
- expand(_imp->env, p->second);
+ for (auto & p : q->second)
+ expand(_imp->env, p.second);
}
for (auto p(_imp->unqualified.begin()), p_end(_imp->unqualified.end()) ;
@@ -196,22 +194,20 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
SpecificMap::const_iterator i(_imp->qualified.find(e->name()));
if (i != _imp->qualified.end())
{
- for (PDSToLicensesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
- j != j_end ; ++j)
+ for (const auto & j : i->second)
{
- if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
+ if (! match_package(*_imp->env, *j.first, e, nullptr, { }))
continue;
- for (LicensesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j.second)
{
- if (*l == t)
+ if (l == t)
return true;
- if (*l == "*")
+ if (l == "*")
return true;
- if (*l == "-*")
+ if (l == "-*")
break_when_done = true;
}
}
@@ -267,13 +263,12 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
continue;
- for (LicensesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j->second)
{
- if (*l == t)
+ if (l == t)
return true;
- if (*l == "*")
+ if (l == "*")
return true;
}
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 4bc180843..033ce77a2 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -507,15 +507,14 @@ PaludisEnvironment::populate_sets() const
sets_dirs.push_back(FSPath(LIBDIR) / "paludis" / "sets");
}
- for (auto sets_dir(sets_dirs.begin()), sets_dir_end(sets_dirs.end()) ;
- sets_dir != sets_dir_end ; ++ sets_dir)
+ for (auto & sets_dir : sets_dirs)
{
- Context context("When looking in sets directory '" + stringify(*sets_dir) + "':");
+ Context context("When looking in sets directory '" + stringify(sets_dir) + "':");
- if (! sets_dir->stat().exists())
+ if (! sets_dir.stat().exists())
continue;
- for (FSIterator d(*sets_dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(sets_dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
if (is_file_with_extension(*d, ".bash", { }))
{
diff --git a/paludis/environments/paludis/suggestions_conf.cc b/paludis/environments/paludis/suggestions_conf.cc
index bedf4046a..89529da6b 100644
--- a/paludis/environments/paludis/suggestions_conf.cc
+++ b/paludis/environments/paludis/suggestions_conf.cc
@@ -190,30 +190,28 @@ SuggestionsConf::interest_in_suggestion(
SpecificMap::const_iterator i(_imp->qualified.find(from_id->name()));
if (i != _imp->qualified.end())
{
- for (PDSToValuesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
- j != j_end ; ++j)
+ for (const auto & j : i->second)
{
- if (! match_package(*_imp->env, *j->first, from_id, nullptr, { }))
+ if (! match_package(*_imp->env, *j.first, from_id, nullptr, { }))
continue;
- for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j.second)
{
- if (! l->group_requirement.empty())
+ if (! l.group_requirement.empty())
{
- if (spec_group == l->group_requirement)
- return l->negated ? false : true;
+ if (spec_group == l.group_requirement)
+ return l.negated ? false : true;
}
else
{
- if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (! l.pkg_requirement.empty())
+ if (stringify(spec.package_ptr()->package()) != l.pkg_requirement)
continue;
- if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (! l.cat_requirement.empty())
+ if (stringify(spec.package_ptr()->category()) != l.cat_requirement)
continue;
- return l->negated ? false : true;
+ return l.negated ? false : true;
}
}
}
@@ -271,24 +269,23 @@ SuggestionsConf::interest_in_suggestion(
if (! match_package(*_imp->env, *j->first, from_id, nullptr, { }))
continue;
- for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j->second)
{
- if (! l->group_requirement.empty())
+ if (! l.group_requirement.empty())
{
- if (spec_group == l->group_requirement)
- return l->negated ? false : true;
+ if (spec_group == l.group_requirement)
+ return l.negated ? false : true;
}
else
{
- if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (! l.pkg_requirement.empty())
+ if (stringify(spec.package_ptr()->package()) != l.pkg_requirement)
continue;
- if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (! l.cat_requirement.empty())
+ if (stringify(spec.package_ptr()->category()) != l.cat_requirement)
continue;
- return l->negated ? false : true;
+ return l.negated ? false : true;
}
}
}