RedisWriter#GenerateHmsetStatements(): reduce memory allocations

This commit is contained in:
Alexander A. Klimov 2019-06-27 16:11:51 +02:00 committed by Michael Friedrich
parent 23448b0322
commit c24092a64e
1 changed files with 2 additions and 3 deletions

View File

@ -255,11 +255,10 @@ std::map<String, std::vector<String> > RedisWriter::GenerateHmsetStatements(cons
{
std::map<String, std::vector<String> > statements;
for (auto& key : keys) {
std::vector<String> statement = {"HMSET", key};
statements.insert(std::pair<String, std::vector<String> >(key, statement));
statements.emplace(key, std::vector<String>({"HMSET", key}));
}
return statements;
return std::move(statements);
}
std::vector<String> RedisWriter::GetTypeObjectKeys(const String& type)