X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6a3da7a60bbd7ec72596a68c6e8e79c19cb04729..f8477782df203e1998a8704e71a1a3cc699e9e3a:/apt-pkg/pkgcache.cc diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 484cde5f4..9926befe9 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcache.cc,v 1.36 2001/07/01 22:28:24 jgg Exp $ +// $Id: pkgcache.cc,v 1.37 2003/02/10 01:40:58 doogie Exp $ /* ###################################################################### Package Cache - Accessor code for the cache @@ -139,12 +139,12 @@ bool pkgCache::ReMap() // Locate our VS.. if (HeaderP->VerSysName == 0 || (VS = pkgVersioningSystem::GetVS(StrP + HeaderP->VerSysName)) == 0) - return _error->Error(_("This APT does not support the Versioning System '%s'"),StrP + HeaderP->VerSysName); + return _error->Error(_("This APT does not support the versioning system '%s'"),StrP + HeaderP->VerSysName); // Chcek the arhcitecture if (HeaderP->Architecture == 0 || _config->Find("APT::Architecture") != StrP + HeaderP->Architecture) - return _error->Error(_("The package cache was build for a different architecture")); + return _error->Error(_("The package cache was built for a different architecture")); return true; } /*}}}*/ @@ -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)];