X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/33aa2752e7c7a6f0a01b191111aa35a5fe69cf20..88ac08f98958386bb268c3c756f56a1367a7a671:/apt-pkg/pkgcache.cc diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 27a0ba035..1705f836b 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -58,8 +58,8 @@ pkgCache::Header::Header() /* Whenever the structures change the major version should be bumped, whenever the generator changes the minor version should be bumped. */ - APT_HEADER_SET(MajorVersion, 10); - APT_HEADER_SET(MinorVersion, 6); + APT_HEADER_SET(MajorVersion, 11); + APT_HEADER_SET(MinorVersion, 0); APT_HEADER_SET(Dirty, false); APT_HEADER_SET(HeaderSz, sizeof(pkgCache::Header)); @@ -154,6 +154,7 @@ bool pkgCache::ReMap(bool const &Errorchecks) VerP = (Version *)Map.Data(); DescP = (Description *)Map.Data(); ProvideP = (Provides *)Map.Data(); + TagP = (Tag *)Map.Data(); DepP = (Dependency *)Map.Data(); DepDataP = (DependencyData *)Map.Data(); StrP = (char *)Map.Data(); @@ -213,14 +214,14 @@ map_id_t pkgCache::sHash(StringView Str) const { uint32_t Hash = 5381; for (auto I = Str.begin(); I != Str.end(); ++I) - Hash = 33 * Hash + tolower_ascii(*I); + Hash = 33 * Hash + tolower_ascii_unsafe(*I); return Hash % HeaderP->GetHashTableSize(); } map_id_t pkgCache::sHash(const string &Str) const { uint32_t Hash = 5381; for (string::const_iterator I = Str.begin(); I != Str.end(); ++I) - Hash = 33 * Hash + tolower_ascii((signed char)*I); + Hash = 33 * Hash + tolower_ascii_unsafe((signed char)*I); return Hash % HeaderP->GetHashTableSize(); } @@ -228,7 +229,7 @@ map_id_t pkgCache::sHash(const char *Str) const { uint32_t Hash = 5381; for (const char *I = Str; *I != 0; ++I) - Hash = 33 * Hash + tolower_ascii((signed char)*I); + Hash = 33 * Hash + tolower_ascii_unsafe((signed char)*I); return Hash % HeaderP->GetHashTableSize(); } @@ -309,7 +310,7 @@ pkgCache::GrpIterator pkgCache::FindGrp(StringView Name) { // Look at the hash bucket for the group Group *Grp = GrpP + HeaderP->GrpHashTableP()[sHash(Name)]; for (; Grp != GrpP; Grp = GrpP + Grp->Next) { - int const cmp = Name.compare(ViewString(Grp->Name)); + int const cmp = StringViewCompareFast(Name, ViewString(Grp->Name)); if (cmp == 0) return GrpIterator(*this, Grp); else if (cmp < 0)