summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
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/cacheiterators.h
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/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index f2aae7272..12a03eb07 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -159,7 +159,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
enum OkState {NeedsNothing,NeedsUnpack,NeedsConfigure};
// Accessors
- inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
+ inline const char *Name() const { return Group().Name(); }
// Versions have sections - and packages can have different versions with different sections
// so this interface is broken by design. It used to return the section of the "first parsed
// package stanza", but as this can potentially be anything it now returns the section of the
@@ -336,7 +336,7 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> {
inline void operator ++() {operator ++(0);}
// Accessors
- inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;}
+ inline const char *Name() const {return ParentPkg().Name();}
inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;}
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);}
inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);}