mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-30 10:25:12 +02:00
tidy: modernize-use-emplace
This commit is contained in:
@@ -1930,7 +1930,7 @@ static RPCHelpMan getblockstats()
|
||||
// New feerate uses satoshis per virtual byte instead of per serialized byte
|
||||
CAmount feerate = weight ? (txfee * WITNESS_SCALE_FACTOR) / weight : 0;
|
||||
if (do_feerate_percentiles) {
|
||||
feerate_array.emplace_back(std::make_pair(feerate, weight));
|
||||
feerate_array.emplace_back(feerate, weight);
|
||||
}
|
||||
maxfeerate = std::max(maxfeerate, feerate);
|
||||
minfeerate = std::min(minfeerate, feerate);
|
||||
|
||||
@@ -1581,10 +1581,10 @@ static RPCHelpMan createpsbt()
|
||||
PartiallySignedTransaction psbtx;
|
||||
psbtx.tx = rawTx;
|
||||
for (unsigned int i = 0; i < rawTx.vin.size(); ++i) {
|
||||
psbtx.inputs.push_back(PSBTInput());
|
||||
psbtx.inputs.emplace_back();
|
||||
}
|
||||
for (unsigned int i = 0; i < rawTx.vout.size(); ++i) {
|
||||
psbtx.outputs.push_back(PSBTOutput());
|
||||
psbtx.outputs.emplace_back();
|
||||
}
|
||||
|
||||
// Serialize the PSBT
|
||||
@@ -1648,10 +1648,10 @@ static RPCHelpMan converttopsbt()
|
||||
PartiallySignedTransaction psbtx;
|
||||
psbtx.tx = tx;
|
||||
for (unsigned int i = 0; i < tx.vin.size(); ++i) {
|
||||
psbtx.inputs.push_back(PSBTInput());
|
||||
psbtx.inputs.emplace_back();
|
||||
}
|
||||
for (unsigned int i = 0; i < tx.vout.size(); ++i) {
|
||||
psbtx.outputs.push_back(PSBTOutput());
|
||||
psbtx.outputs.emplace_back();
|
||||
}
|
||||
|
||||
// Serialize the PSBT
|
||||
|
||||
@@ -88,7 +88,7 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
|
||||
vCommands.reserve(mapCommands.size());
|
||||
|
||||
for (const auto& entry : mapCommands)
|
||||
vCommands.push_back(make_pair(entry.second.front()->category + entry.first, entry.second.front()));
|
||||
vCommands.emplace_back(entry.second.front()->category + entry.first, entry.second.front());
|
||||
sort(vCommands.begin(), vCommands.end());
|
||||
|
||||
JSONRPCRequest jreq = helpreq;
|
||||
|
||||
Reference in New Issue
Block a user