summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-12-27 01:33:38 +0100
committerJulian Andres Klode <jak@debian.org>2015-12-27 01:46:06 +0100
commite9185eca390435b4060ef26c7c69d39f994da7a7 (patch)
treed77ecc772e65180b9ff0bad0a5a6961b7e60d426 /apt-pkg/pkgcachegen.h
parent74dedb4ae28fd4f7c89bf769708d4f7edc7ed79a (diff)
pkgcachegen: Use std::unordered_map instead of std::map
std::unordered_map is faster than std::map in our use case, reducing cache generation time by about 10% in my benchmark.
Diffstat (limited to 'apt-pkg/pkgcachegen.h')
-rw-r--r--apt-pkg/pkgcachegen.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index 328d296bf..9001e334f 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -26,7 +26,7 @@
#include <vector>
#include <string>
-#include <map>
+#include <unordered_map>
class FileFd;
class pkgSourceList;
@@ -41,10 +41,10 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/
APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String, const unsigned long &Len);
APT_HIDDEN map_pointer_t AllocateInMap(const unsigned long &size);
- std::map<std::string,map_stringitem_t> strMixed;
- std::map<std::string,map_stringitem_t> strSections;
- std::map<std::string,map_stringitem_t> strPkgNames;
- std::map<std::string,map_stringitem_t> strVersions;
+ std::unordered_map<std::string,map_stringitem_t> strMixed;
+ std::unordered_map<std::string,map_stringitem_t> strSections;
+ std::unordered_map<std::string,map_stringitem_t> strPkgNames;
+ std::unordered_map<std::string,map_stringitem_t> strVersions;
friend class pkgCacheListParser;
typedef pkgCacheListParser ListParser;