aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-09-21 11:03:21 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-09-21 11:03:21 +0200
commitb6718e373ed425fa2440ddd8f1b05c76b782dc2b (patch)
tree4e710e94ee3946bac22b1932d3b982102a24155f /src/bench
parent8f464549c46db2954d7b64d1feb200eb35f2e7e8 (diff)
downloadbitcoin-b6718e373ed425fa2440ddd8f1b05c76b782dc2b.tar.xz
tests: Use MakeUnique to construct objects owned by unique_ptrs
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/bench_bitcoin.cpp2
-rw-r--r--src/bench/coin_selection.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/bench/bench_bitcoin.cpp b/src/bench/bench_bitcoin.cpp
index d7b8083e7c..4fa516cb81 100644
--- a/src/bench/bench_bitcoin.cpp
+++ b/src/bench/bench_bitcoin.cpp
@@ -82,7 +82,7 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}
- std::unique_ptr<benchmark::Printer> printer(new benchmark::ConsolePrinter());
+ std::unique_ptr<benchmark::Printer> printer = MakeUnique<benchmark::ConsolePrinter>();
std::string printer_arg = gArgs.GetArg("-printer", DEFAULT_BENCH_PRINTER);
if ("plot" == printer_arg) {
printer.reset(new benchmark::PlotlyPrinter(
diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp
index 0a6f5d85ea..27c23d6834 100644
--- a/src/bench/coin_selection.cpp
+++ b/src/bench/coin_selection.cpp
@@ -66,7 +66,7 @@ static void add_coin(const CAmount& nValue, int nInput, std::vector<OutputGroup>
CMutableTransaction tx;
tx.vout.resize(nInput + 1);
tx.vout[nInput].nValue = nValue;
- std::unique_ptr<CWalletTx> wtx(new CWalletTx(&testWallet, MakeTransactionRef(std::move(tx))));
+ std::unique_ptr<CWalletTx> wtx = MakeUnique<CWalletTx>(&testWallet, MakeTransactionRef(std::move(tx)));
set.emplace_back(COutput(wtx.get(), nInput, 0, true, true, true).GetInputCoin(), 0, true, 0, 0);
wtxn.emplace_back(std::move(wtx));
}