mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.
This commit is contained in:
@@ -245,7 +245,7 @@ BOOST_AUTO_TEST_CASE(util_GetBoolArg)
|
||||
testArgs.ParseParameters(7, (char**)argv_test, error);
|
||||
|
||||
// Each letter should be set.
|
||||
for (char opt : "abcdef")
|
||||
for (const char opt : "abcdef")
|
||||
BOOST_CHECK(testArgs.IsArgSet({'-', opt}) || !opt);
|
||||
|
||||
// Nothing else should be in the map
|
||||
@@ -394,7 +394,7 @@ BOOST_AUTO_TEST_CASE(util_ReadConfigStream)
|
||||
&& test_args.GetArg("-iii", "xxx") == "xxx"
|
||||
);
|
||||
|
||||
for (bool def : {false, true}) {
|
||||
for (const bool def : {false, true}) {
|
||||
BOOST_CHECK(test_args.GetBoolArg("-a", def)
|
||||
&& test_args.GetBoolArg("-b", def)
|
||||
&& !test_args.GetBoolArg("-ccc", def)
|
||||
|
||||
Reference in New Issue
Block a user