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:
Aurèle Oulès
2022-07-26 11:12:53 +02:00
parent 7f79746bf0
commit 081b0e53e3
27 changed files with 39 additions and 39 deletions

View File

@@ -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;