aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-30 15:59:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-30 15:59:50 +0000
commit2f72bdb7dce06fba4bfa3ae0251f58897053e59b (patch)
treee3c1cae5240a90739fdbafe14d2cbd06c7f8f4de
parent17db83f4c7ac6215ae486111bf38a1f5c441c643 (diff)
downloadpaludis-2f72bdb7dce06fba4bfa3ae0251f58897053e59b.tar.gz
paludis-2f72bdb7dce06fba4bfa3ae0251f58897053e59b.tar.xz
Slight performance tweaks
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc21
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc21
2 files changed, 30 insertions, 12 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index c76506b..0d8fafe 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -141,9 +141,6 @@ bool
InstalledVirtualsRepository::do_query_repository_masks(const QualifiedPackageName &,
const VersionSpec &) const
{
- need_entries();
-
- /// \todo
return false;
}
@@ -151,9 +148,6 @@ bool
InstalledVirtualsRepository::do_query_profile_masks(const QualifiedPackageName &,
const VersionSpec &) const
{
- need_entries();
-
- /// \todo
return false;
}
@@ -183,6 +177,9 @@ bool
InstalledVirtualsRepository::do_has_version(const QualifiedPackageName & q,
const VersionSpec & v) const
{
+ if (q.category.data() != "virtual")
+ return false;
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -195,6 +192,9 @@ InstalledVirtualsRepository::do_has_version(const QualifiedPackageName & q,
VersionSpecCollection::ConstPointer
InstalledVirtualsRepository::do_version_specs(const QualifiedPackageName & q) const
{
+ if (q.category.data() != "virtual")
+ return VersionSpecCollection::Pointer(new VersionSpecCollection::Concrete);
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -212,6 +212,9 @@ InstalledVirtualsRepository::do_version_specs(const QualifiedPackageName & q) co
QualifiedPackageNameCollection::ConstPointer
InstalledVirtualsRepository::do_package_names(const CategoryNamePart & c) const
{
+ if (c.data() != "virtual")
+ return QualifiedPackageNameCollection::Pointer(new QualifiedPackageNameCollection::Concrete);
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -257,6 +260,9 @@ InstalledVirtualsRepository::do_category_names() const
bool
InstalledVirtualsRepository::do_has_package_named(const QualifiedPackageName & q) const
{
+ if (q.category.data() != "virtual")
+ return false;
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -270,6 +276,9 @@ InstalledVirtualsRepository::do_has_package_named(const QualifiedPackageName & q
bool
InstalledVirtualsRepository::do_has_category_named(const CategoryNamePart & c) const
{
+ if (c.data() != "virtual")
+ return false;
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index c68047c..51145f3 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -136,9 +136,6 @@ bool
VirtualsRepository::do_query_repository_masks(const QualifiedPackageName &,
const VersionSpec &) const
{
- need_entries();
-
- /// \todo
return false;
}
@@ -146,9 +143,6 @@ bool
VirtualsRepository::do_query_profile_masks(const QualifiedPackageName &,
const VersionSpec &) const
{
- need_entries();
-
- /// \todo
return false;
}
@@ -177,6 +171,9 @@ bool
VirtualsRepository::do_has_version(const QualifiedPackageName & q,
const VersionSpec & v) const
{
+ if (q.category.data() != "virtual")
+ return false;
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -189,6 +186,9 @@ VirtualsRepository::do_has_version(const QualifiedPackageName & q,
VersionSpecCollection::ConstPointer
VirtualsRepository::do_version_specs(const QualifiedPackageName & q) const
{
+ if (q.category.data() != "virtual")
+ return VersionSpecCollection::Pointer(new VersionSpecCollection::Concrete);
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -206,6 +206,9 @@ VirtualsRepository::do_version_specs(const QualifiedPackageName & q) const
QualifiedPackageNameCollection::ConstPointer
VirtualsRepository::do_package_names(const CategoryNamePart & c) const
{
+ if (c.data() != "virtual")
+ return QualifiedPackageNameCollection::Pointer(new QualifiedPackageNameCollection::Concrete);
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -251,6 +254,9 @@ VirtualsRepository::do_category_names() const
bool
VirtualsRepository::do_has_package_named(const QualifiedPackageName & q) const
{
+ if (q.category.data() != "virtual")
+ return false;
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(
@@ -264,6 +270,9 @@ VirtualsRepository::do_has_package_named(const QualifiedPackageName & q) const
bool
VirtualsRepository::do_has_category_named(const CategoryNamePart & c) const
{
+ if (c.data() != "virtual")
+ return false;
+
need_entries();
std::pair<std::vector<VREntry>::const_iterator, std::vector<VREntry>::const_iterator> p(