mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-07 13:18:43 +02:00
rpc: avoid copying into UniValue
These are simple (and hopefully obviously correct) copies that can be moves instead.
This commit is contained in:
@@ -174,11 +174,11 @@ static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::
|
||||
for (unsigned int i = 0; i < txin.scriptWitness.stack.size(); i++) {
|
||||
witness.push_back(HexStr(txin.scriptWitness.stack[i]));
|
||||
}
|
||||
entry.pushKV("witness", witness);
|
||||
entry.pushKV("witness", std::move(witness));
|
||||
entry.pushKV("scriptSig", HexStr(txin.scriptSig));
|
||||
entry.pushKV("sequence", (uint64_t)txin.nSequence);
|
||||
entry.pushKV("error", strMessage);
|
||||
vErrorsRet.push_back(entry);
|
||||
vErrorsRet.push_back(std::move(entry));
|
||||
}
|
||||
|
||||
void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keystore, std::map<COutPoint, Coin>& coins)
|
||||
@@ -331,6 +331,6 @@ void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const
|
||||
if (result.exists("errors")) {
|
||||
vErrors.push_backV(result["errors"].getValues());
|
||||
}
|
||||
result.pushKV("errors", vErrors);
|
||||
result.pushKV("errors", std::move(vErrors));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user