diff options
author | Julian Andres Klode <jak@debian.org> | 2016-01-08 11:12:14 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-01-08 21:20:25 +0100 |
commit | 60d523e2ae93a6c5bc396b6bede2544271fb1f2e (patch) | |
tree | 949bac3513d69f66d7df6dbc92afca564b2eb8b6 /apt-pkg/pkgcachegen.cc | |
parent | af4899c9df6e925b1cb099c29bd78788b2984cca (diff) |
Store the size of strings in the cache
By storing the size of the string in the cache, we can make use of
it when comparing the names in the hashtable in pkgCache::FindGrp.
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 80392ff45..a26237296 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -518,7 +518,8 @@ bool pkgCacheGenerator::NewGroup(pkgCache::GrpIterator &Grp, StringView Name) // Insert it into the hash table unsigned long const Hash = Cache.Hash(Name); map_pointer_t *insertAt = &Cache.HeaderP->GrpHashTableP()[Hash]; - while (*insertAt != 0 && Name.compare(Cache.StrP + (Cache.GrpP + *insertAt)->Name) > 0) + + while (*insertAt != 0 && Name.compare(Cache.ViewString((Cache.GrpP + *insertAt)->Name)) > 0) insertAt = &(Cache.GrpP + *insertAt)->Next; Grp->Next = *insertAt; *insertAt = Group; |