summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-02-01 07:28:12 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2017-02-01 07:28:12 -0800
commit35d8bb14e1102f0231432c7ad33be414e07a15e6 (patch)
tree894e7b770365522d2de024d82b0e0ec8d9a217d7
parentc2fb49ca1783b9ea2dd8b7cb90a2284750076c65 (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 7152f04e2..1b4c89f84 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;
@@ -1379,6 +1379,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 541e143ba..27fd8d4d0 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -78,6 +78,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;
@@ -132,7 +133,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