summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-07-13 12:47:05 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-10 17:27:18 +0200
commitfd23676e809b7fa87ae138cc22d2c683d212950e (patch)
treeb11da2587ec5bd22b1013f087c46f114f8d53d24 /apt-pkg/depcache.h
parent3707fd4faab3f2e2521263070b68fd0afaae2900 (diff)
bunch of micro-optimizations for depcache
DepCache functions are called a lot, so if we can squeeze some drops out of them for free we should do so. Takes also the opportunity to remove some whitespace errors from these functions. Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/depcache.h')
-rw-r--r--apt-pkg/depcache.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 2c3304ba8..aa281f695 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -267,7 +267,7 @@ class pkgDepCache : protected pkgCache::Namespace
// Helper functions
void BuildGroupOrs(VerIterator const &V);
- void UpdateVerState(PkgIterator Pkg);
+ void UpdateVerState(PkgIterator const &Pkg);
// User Policy control
class Policy
@@ -279,7 +279,7 @@ class pkgDepCache : protected pkgCache::Namespace
}
virtual VerIterator GetCandidateVer(PkgIterator const &Pkg);
- virtual bool IsImportantDep(DepIterator const &Dep);
+ virtual bool IsImportantDep(DepIterator const &Dep) const;
virtual signed short GetPriority(PkgIterator const &Pkg);
virtual signed short GetPriority(PkgFileIterator const &File);
@@ -323,18 +323,18 @@ class pkgDepCache : protected pkgCache::Namespace
Policy *LocalPolicy;
// Check for a matching provides
- bool CheckDep(DepIterator Dep,int Type,PkgIterator &Res);
- inline bool CheckDep(DepIterator Dep,int Type)
+ bool CheckDep(DepIterator const &Dep,int const Type,PkgIterator &Res);
+ inline bool CheckDep(DepIterator const &Dep,int const Type)
{
PkgIterator Res(*this,0);
return CheckDep(Dep,Type,Res);
}
// Computes state information for deps and versions (w/o storing)
- unsigned char DependencyState(DepIterator &D);
- unsigned char VersionState(DepIterator D,unsigned char Check,
- unsigned char SetMin,
- unsigned char SetPolicy);
+ unsigned char DependencyState(DepIterator const &D);
+ unsigned char VersionState(DepIterator D,unsigned char const Check,
+ unsigned char const SetMin,
+ unsigned char const SetPolicy) const;
// Recalculates various portions of the cache, call after changing something
void Update(DepIterator Dep); // Mostly internal
@@ -362,7 +362,7 @@ class pkgDepCache : protected pkgCache::Namespace
// Policy implementation
inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return LocalPolicy->GetCandidateVer(Pkg);};
- inline bool IsImportantDep(DepIterator Dep) {return LocalPolicy->IsImportantDep(Dep);};
+ inline bool IsImportantDep(DepIterator Dep) const {return LocalPolicy->IsImportantDep(Dep);};
inline Policy &GetPolicy() {return *LocalPolicy;};
// Accessors
@@ -471,8 +471,8 @@ class pkgDepCache : protected pkgCache::Namespace
unsigned long Depth = 0, bool FromUser = true);
// read persistent states
- bool readStateFile(OpProgress *prog);
- bool writeStateFile(OpProgress *prog, bool InstalledOnly=true);
+ bool readStateFile(OpProgress * const prog);
+ bool writeStateFile(OpProgress * const prog, bool const InstalledOnly=true);
// Size queries
inline signed long long UsrSize() {return iUsrSize;};
@@ -484,11 +484,11 @@ class pkgDepCache : protected pkgCache::Namespace
inline unsigned long PolicyBrokenCount() {return iPolicyBrokenCount;};
inline unsigned long BadCount() {return iBadCount;};
- bool Init(OpProgress *Prog);
+ bool Init(OpProgress * const Prog);
// Generate all state information
- void Update(OpProgress *Prog = 0);
+ void Update(OpProgress * const Prog = 0);
- pkgDepCache(pkgCache *Cache,Policy *Plcy = 0);
+ pkgDepCache(pkgCache * const Cache,Policy * const Plcy = 0);
virtual ~pkgDepCache();
protected: