aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-23 10:51:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-23 10:51:16 +0000
commitdfdece66f1187b32f70336f22a333b55b40fc70f (patch)
tree80f1568064b66f6b2f09e91f14f7569a54568c6b
parent0cb04b93f0311a608cf1ed7f33e42f5ff0e70ca3 (diff)
downloadpaludis-dfdece66f1187b32f70336f22a333b55b40fc70f.tar.gz
paludis-dfdece66f1187b32f70336f22a333b55b40fc70f.tar.xz
Make category loading faster
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc11
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc10
2 files changed, 7 insertions, 14 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 0d8fafe..6c8807c 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -240,15 +240,12 @@ InstalledVirtualsRepository::do_package_names(const CategoryNamePart & c) const
CategoryNamePartCollection::ConstPointer
InstalledVirtualsRepository::do_category_names() const
{
- need_entries();
-
CategoryNamePartCollection::Pointer result(new CategoryNamePartCollection::Concrete);
+ result->insert(CategoryNamePart("virtual"));
+
#if 0
- /// \todo: in theory, this can be a lot lot lot faster
- for (std::vector<VREntry>::const_iterator p(_imp->entries.begin()), p_end(_imp->entries.end()) ;
- p != p_end ; ++p)
- result->insert(p->virtual_name.category);
-#else
+ need_entries();
+
fast_unique_copy(_imp->entries.begin(), _imp->entries.end(),
transform_inserter(result->inserter(), EntriesCategoryExtractor()),
EntriesCategoryComparator());
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 631d958..d04c991 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -256,15 +256,11 @@ VirtualsRepository::do_package_names(const CategoryNamePart & c) const
CategoryNamePartCollection::ConstPointer
VirtualsRepository::do_category_names() const
{
- need_entries();
-
CategoryNamePartCollection::Pointer result(new CategoryNamePartCollection::Concrete);
+ result->insert(CategoryNamePart("virtual"));
#if 0
- /// \todo: in theory, this can be a lot lot lot faster
- for (std::vector<VREntry>::const_iterator p(_imp->entries.begin()), p_end(_imp->entries.end()) ;
- p != p_end ; ++p)
- result->insert(p->virtual_name.category);
-#else
+ need_entries();
+
fast_unique_copy(_imp->entries.begin(), _imp->entries.end(),
transform_inserter(result->inserter(), EntriesCategoryExtractor()),
EntriesCategoryComparator());