diff options
author | Julian Andres Klode <jak@debian.org> | 2016-01-08 00:25:45 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-01-08 00:32:26 +0100 |
commit | c5a858e39f83676fdf16f1bdae5966c96ee882ff (patch) | |
tree | d1db4e6d57f341750617eb875a35efa0696979cd /apt-pkg | |
parent | 0e58689ae76e8155bc1f418323aa9e56c34187f6 (diff) |
pkgCacheGenerator::StoreString: Move the string into the map
Moving the string is likely faster than copying it. We could probably
avoid strings alltogether in the future using some more crazy code,
but I have not looked at that yet.
Gbp-Dch: ignore
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index abc326558..db8131651 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1257,7 +1257,7 @@ bool pkgCacheGenerator::SelectFile(std::string const &File, map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, const char *S, unsigned int Size) { - std::string const key(S, Size); + std::string key(S, Size); std::unordered_map<std::string,map_stringitem_t> * strings; switch(type) { @@ -1273,7 +1273,7 @@ map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, cons return item->second; map_stringitem_t const idxString = WriteStringInMap(S,Size); - strings->insert(std::make_pair(key, idxString)); + strings->insert(std::make_pair(std::move(key), idxString)); return idxString; } /*}}}*/ |