Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.

This commit is contained in:
practicalswift
2018-06-18 07:58:28 +02:00
parent f180e81d57
commit f34c8c466a
36 changed files with 77 additions and 77 deletions

View File

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