diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-07-13 23:10:53 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-10 17:27:18 +0200 |
commit | 3707fd4faab3f2e2521263070b68fd0afaae2900 (patch) | |
tree | e0730218bbd83e2631f657dd0b39156f602fa065 /apt-private/private-cachefile.h | |
parent | 9112f77703c39d46e2e0471c48c8a5e1f93f4abf (diff) |
avoid virtual in the iterators
With a bit of trickery and the Curiously recurring template pattern we
can free us from our use of virtual in the iterators were it is unneeded
bloat as we never deal with pointers to iterators and similar such.
Git-Dch: Ignore
Diffstat (limited to 'apt-private/private-cachefile.h')
-rw-r--r-- | apt-private/private-cachefile.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index 221852629..ed9342db0 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -72,13 +72,12 @@ public: class const_iterator : public APT::Container_iterator_base<APT::PackageContainerInterface, SortedPackageUniverse, SortedPackageUniverse::const_iterator, std::vector<map_pointer_t>::const_iterator, pkgCache::PkgIterator> { pkgCache * const Cache; - protected: - inline virtual pkgCache::PkgIterator getType(void) const APT_OVERRIDE + public: + inline pkgCache::PkgIterator getType(void) const { if (*_iter == 0) return pkgCache::PkgIterator(*Cache); return pkgCache::PkgIterator(*Cache, Cache->PkgP + *_iter); } - public: explicit const_iterator(pkgCache * const Owner, std::vector<map_pointer_t>::const_iterator i): Container_iterator_base<APT::PackageContainerInterface, SortedPackageUniverse, SortedPackageUniverse::const_iterator, std::vector<map_pointer_t>::const_iterator, pkgCache::PkgIterator>(i), Cache(Owner) {} |