aboutsummaryrefslogtreecommitdiff
path: root/paludis/package_id.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/package_id.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/package_id.cc')
-rw-r--r--paludis/package_id.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index abc0157b5..550136c75 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -174,8 +174,8 @@ PackageIDComparator::PackageIDComparator(const Environment * const e) :
_imp()
{
unsigned c(0);
- for (auto r(e->begin_repositories()), r_end(e->end_repositories()) ; r != r_end ; ++r)
- _imp->m.insert(std::make_pair((*r)->name(), ++c));
+ for (const auto & repository : e->repositories())
+ _imp->m.insert(std::make_pair(repository->name(), ++c));
}
PackageIDComparator::PackageIDComparator(const PackageIDComparator & other) :