summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-06-19 11:00:02 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 00:09:09 +0200
commitfe86debbae914b51d2799e7b24abfd1f944f8caf (patch)
tree8c97eca81decc53d63f6b74cef78eb3eef29d0cf /apt-pkg/pkgcache.cc
parentd36b27305dae21f9b3b6de056853ecd8bbd157e6 (diff)
deprecate Pkg->Name in favor of Grp->Name
They both store the same information, so this field just takes up space in the Package struct for no good reason. We mark it "just" as deprecated instead of instantly removing it though as it isn't misleading like Section was and is potentially used in the wild more often.
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index b1ed0129d..7a913d2bb 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -215,10 +215,7 @@ pkgCache::PkgIterator pkgCache::SingleArchFindPkg(const string &Name)
Package *Pkg = PkgP + HeaderP->PkgHashTable()[Hash(Name)];
for (; Pkg != PkgP; Pkg = PkgP + Pkg->Next)
{
- if (unlikely(Pkg->Name == 0))
- continue;
-
- int const cmp = strcasecmp(Name.c_str(), StrP + Pkg->Name);
+ int const cmp = strcasecmp(Name.c_str(), StrP + (GrpP + Pkg->Group)->Name);
if (cmp == 0)
return PkgIterator(*this, Pkg);
else if (cmp < 0)
@@ -370,7 +367,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const {
so we need to check the name also */
for (pkgCache::Package *Pkg = PackageList(); Pkg != Owner->PkgP;
Pkg = Owner->PkgP + Pkg->Next) {
- if (S->Name == Pkg->Name &&
+ if (S->Name == (Owner->GrpP + Pkg->Group)->Name &&
stringcasecmp(Arch, Owner->StrP + Pkg->Arch) == 0)
return PkgIterator(*Owner, Pkg);
if ((Owner->PkgP + S->LastPackage) == Pkg)
@@ -1037,7 +1034,7 @@ bool pkgCache::PrvIterator::IsMultiArchImplicit() const
{
pkgCache::PkgIterator const Owner = OwnerPkg();
pkgCache::PkgIterator const Parent = ParentPkg();
- if (strcmp(Owner.Arch(), Parent.Arch()) != 0 || Owner->Name == Parent->Name)
+ if (strcmp(Owner.Arch(), Parent.Arch()) != 0 || Owner.Group()->Name == Parent.Group()->Name)
return true;
return false;
}