From 60d523e2ae93a6c5bc396b6bede2544271fb1f2e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 8 Jan 2016 11:12:14 +0100 Subject: 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. --- apt-pkg/pkgcachegen.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/pkgcachegen.cc') 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; -- cgit v1.2.3