summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-11-23 00:00:13 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-11-23 00:00:13 +0000
commit171c75f13acc955110a6c4693c7b8fe243709843 (patch)
tree5ab08f93a83b026a12cab131061ddf91cbf476f2 /apt-pkg/pkgcache.cc
parent7c6e2dc761f736bf203f7770f7a1c4a63f7063d4 (diff)
* applied parts of the string speedup patch from debian #319377 (ABI change)
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 6ef7cafb0..9926befe9 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -153,7 +153,7 @@ bool pkgCache::ReMap()
/* This is used to generate the hash entries for the HashTable. With my
package list from bo this function gets 94% table usage on a 512 item
table (480 used items) */
-unsigned long pkgCache::sHash(string Str) const
+unsigned long pkgCache::sHash(const string &Str) const
{
unsigned long Hash = 0;
for (string::const_iterator I = Str.begin(); I != Str.end(); I++)
@@ -173,7 +173,7 @@ unsigned long pkgCache::sHash(const char *Str) const
// Cache::FindPkg - Locate a package by name /*{{{*/
// ---------------------------------------------------------------------
/* Returns 0 on error, pointer to the package otherwise */
-pkgCache::PkgIterator pkgCache::FindPkg(string Name)
+pkgCache::PkgIterator pkgCache::FindPkg(const string &Name)
{
// Look at the hash bucket
Package *Pkg = PkgP + HeaderP->HashTable[Hash(Name)];