// Find the right version to write the description
MD5SumValue CurMd5 = List.Description_md5();
- if (CurMd5.Value().empty() == true && List.Description("").empty() == true)
- return true;
std::vector<std::string> availDesc = List.AvailableDescriptionLanguages();
for (Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
{
/* Record the Description(s) based on their master md5sum */
MD5SumValue CurMd5 = List.Description_md5();
- if (CurMd5.Value().empty() == true && List.Description("").empty() == true)
- return true;
/* Before we add a new description we first search in the group for
a version with a description of the same MD5 - if so we reuse this
// 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;
{
int const CmpOp = Op & 0x0F;
// =-deps are used (79:1) for lockstep on same-source packages (e.g. data-packages)
- if (CmpOp == pkgCache::Dep::Equals && Version.compare(Ver.VerStr()) == 0)
+ if (CmpOp == pkgCache::Dep::Equals && Version == Ver.VerStr())
idxVersion = Ver->VerStr;
if (idxVersion == 0)
map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, const char *S,
unsigned int Size)
{
- std::string key(S, Size);
-
- std::unordered_map<std::string,map_stringitem_t> * strings;
+ auto strings = &strMixed;
switch(type) {
case MIXED: strings = &strMixed; break;
case PKGNAME: strings = &strPkgNames; break;
case VERSIONNUMBER: strings = &strVersions; break;
case SECTION: strings = &strSections; break;
- default: _error->Fatal("Unknown enum type used for string storage of '%s'", key.c_str()); return 0;
+ default: _error->Fatal("Unknown enum type used for string storage of '%.*s'", Size, S); return 0;
}
- std::unordered_map<std::string,map_stringitem_t>::const_iterator const item = strings->find(key);
+ auto const item = strings->find({S, Size, nullptr, 0});
if (item != strings->end())
- return item->second;
+ return item->item;
map_stringitem_t const idxString = WriteStringInMap(S,Size);
- strings->insert(std::make_pair(std::move(key), idxString));
+ strings->insert({nullptr, Size, this, idxString});
return idxString;
}
/*}}}*/