aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/destination_utils.cc
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2017-01-16 13:03:26 -0800
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2017-01-16 13:56:45 -0800
commit6b0e48f888cf983f6a3e3640c8e2e76a0826632f (patch)
tree47cc378051c6e260f58e149e6f012b264ad20c44 /paludis/resolver/destination_utils.cc
parente023360dbf9b38671dbccbafdfdd26fb87c1c21b (diff)
downloadpaludis-6b0e48f888cf983f6a3e3640c8e2e76a0826632f.tar.gz
paludis-6b0e48f888cf983f6a3e3640c8e2e76a0826632f.tar.xz
paludis: c++11-ify repository iteration
Add a `repositories` in `Environment` which provides an iterator range for the repositories, allowing C++11 style range based iteration.
Diffstat (limited to 'paludis/resolver/destination_utils.cc')
-rw-r--r--paludis/resolver/destination_utils.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/paludis/resolver/destination_utils.cc b/paludis/resolver/destination_utils.cc
index 6f741abe1..de25a35bd 100644
--- a/paludis/resolver/destination_utils.cc
+++ b/paludis/resolver/destination_utils.cc
@@ -65,17 +65,16 @@ namespace
struct BinaryDestinationGeneratorHandler :
AllGeneratorHandlerBase
{
- std::shared_ptr<const RepositoryNameSet> repositories(
- const Environment * const env,
- const RepositoryContentMayExcludes &) const override
+ std::shared_ptr<const RepositoryNameSet>
+ repositories(const Environment * const env,
+ const RepositoryContentMayExcludes &) const override
{
- using namespace std::placeholders;
- std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- for (auto r(env->begin_repositories()), r_end(env->end_repositories()) ;
- r != r_end ; ++r)
- if (! (*r)->installed_root_key())
- if ((*r)->destination_interface())
- result->insert((*r)->name());
+ auto result(std::make_shared<RepositoryNameSet>());
+
+ for (const auto & repository : env->repositories())
+ if (! repository->installed_root_key())
+ if (repository->destination_interface())
+ result->insert(repository->name());
return result;
}