X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/851a45a85fa486abc642e10f19afef11f621c29d..6627bdccce46a9acdae09d37e6e1444a5f7384e1:/apt-pkg/pkgcache.cc diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index d0a86ec69..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.35 2001/05/14 05:54:10 jgg Exp $ +// $Id: pkgcache.cc,v 1.37 2003/02/10 01:40:58 doogie Exp $ /* ###################################################################### Package Cache - Accessor code for the cache @@ -52,8 +52,8 @@ pkgCache::Header::Header() /* Whenever the structures change the major version should be bumped, whenever the generator changes the minor version should be bumped. */ - MajorVersion = 3; - MinorVersion = 5; + MajorVersion = 4; + MinorVersion = 0; Dirty = false; HeaderSz = sizeof(pkgCache::Header); @@ -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)];