mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
refactor: Make const refs vars where applicable
This avoids initializing variables with the copy-constructor of a non-trivially copyable type.
This commit is contained in:
@@ -191,7 +191,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
|
||||
UniValue tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid)));
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
const UniValue& test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test[0].isArray())
|
||||
{
|
||||
@@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
|
||||
fValid = false;
|
||||
break;
|
||||
}
|
||||
UniValue vinput = input.get_array();
|
||||
const UniValue& vinput = input.get_array();
|
||||
if (vinput.size() < 3 || vinput.size() > 4)
|
||||
{
|
||||
fValid = false;
|
||||
@@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
|
||||
UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
const UniValue& test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test[0].isArray())
|
||||
{
|
||||
@@ -299,7 +299,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
|
||||
fValid = false;
|
||||
break;
|
||||
}
|
||||
UniValue vinput = input.get_array();
|
||||
const UniValue& vinput = input.get_array();
|
||||
if (vinput.size() < 3 || vinput.size() > 4)
|
||||
{
|
||||
fValid = false;
|
||||
|
||||
Reference in New Issue
Block a user