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
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) {
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;
}
/*}}}*/