summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-02-01 07:28:12 -0800
committerSam Bingner <sam@bingner.com>2020-07-17 00:22:23 -1000
commite08fb4d48c1534b2b7e9d7df4a8114c0fdd3d516 (patch)
tree918795a90a679af941a835e2b9c905f7c5f9cef2
parent79082a4dc7d747da29f7eb2c3016ec862729e919 (diff)
Tags should use StoreString, not WriteStringInMap.
-rw-r--r--apt-pkg/pkgcachegen.cc3
-rw-r--r--apt-pkg/pkgcachegen.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 796b3b574..6a409f991 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1300,7 +1300,7 @@ bool pkgCacheGenerator::NewTag(pkgCache::VerIterator &Ver,
// Fill it in
pkgCache::TagIterator Tg(Cache,Cache.TagP + idxTag);
- map_pointer_t const idxName = WriteStringInMap(NameStart,NameSize);
+ map_pointer_t const idxName = StoreString(TAG,NameStart,NameSize);
if (idxName == 0)
return false;
Tg->Name = idxName;
@@ -1380,6 +1380,7 @@ map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, cons
case PKGNAME: strings = &strPkgNames; break;
case VERSIONNUMBER: strings = &strVersions; break;
case SECTION: strings = &strSections; break;
+ case TAG: strings = &strTags; break;
default: _error->Fatal("Unknown enum type used for string storage of '%.*s'", Size, S); return 0;
}
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index b42912303..44c54269d 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -77,6 +77,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/
std::unordered_set<string_pointer, hash> strPkgNames;
std::unordered_set<string_pointer, hash> strVersions;
std::unordered_set<string_pointer, hash> strSections;
+ std::unordered_set<string_pointer, hash> strTags;
#endif
friend class pkgCacheListParser;
@@ -131,7 +132,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/
public:
- enum StringType { MIXED, PKGNAME, VERSIONNUMBER, SECTION };
+ enum StringType { MIXED, PKGNAME, VERSIONNUMBER, SECTION, TAG };
map_stringitem_t StoreString(StringType const type, const char * S, unsigned int const Size);
#ifdef APT_PKG_EXPOSE_STRING_VIEW