mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: Avoid copying util::Result values
Copying util::Result values is less efficient than moving them because they allocate memory and contain strings. Also this is needed to avoid compile errors in https://github.com/bitcoin/bitcoin/pull/25722 which adds a std::unique_ptr member to util::Result which implicity disables copying.
This commit is contained in:
@@ -291,7 +291,10 @@ FUZZ_TARGET(coinselection)
|
||||
}
|
||||
|
||||
std::vector<COutput> utxos;
|
||||
std::vector<util::Result<SelectionResult>> results{result_srd, result_knapsack, result_bnb};
|
||||
std::vector<util::Result<SelectionResult>> results;
|
||||
results.emplace_back(std::move(result_srd));
|
||||
results.emplace_back(std::move(result_knapsack));
|
||||
results.emplace_back(std::move(result_bnb));
|
||||
CAmount new_total_balance{CreateCoins(fuzzed_data_provider, utxos, coin_params, next_locktime)};
|
||||
if (new_total_balance > 0) {
|
||||
std::set<std::shared_ptr<COutput>> new_utxo_pool;
|
||||
|
||||
Reference in New Issue
Block a user