mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
rpc: avoid copying into UniValue
These are simple (and hopefully obviously correct) copies that can be moves instead.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user