rpc: avoid copying into UniValue

These are simple (and hopefully obviously correct) copies that can be moves
instead.
This commit is contained in:
Cory Fields
2024-05-13 20:20:10 +00:00
parent ecd23656db
commit d7707d9843
27 changed files with 183 additions and 183 deletions

View File

@@ -241,15 +241,15 @@ static RPCHelpMan getrpcinfo()
UniValue entry(UniValue::VOBJ);
entry.pushKV("method", info.method);
entry.pushKV("duration", int64_t{Ticks<std::chrono::microseconds>(SteadyClock::now() - info.start)});
active_commands.push_back(entry);
active_commands.push_back(std::move(entry));
}
UniValue result(UniValue::VOBJ);
result.pushKV("active_commands", active_commands);
result.pushKV("active_commands", std::move(active_commands));
const std::string path = LogInstance().m_file_path.utf8string();
UniValue log_path(UniValue::VSTR, path);
result.pushKV("logpath", log_path);
result.pushKV("logpath", std::move(log_path));
return result;
}