Skip to content

Commit 3c0073a

Browse files
Avoid unnecessary copies in require_parse_tree.cpp
Without the & we’re copying the items we’re iterating over, which is unnecessary in these cases.
1 parent 2883bb3 commit 3c0073a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jbmc/unit/java-testing-utils/require_parse_tree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const require_parse_tree::methodt require_parse_tree::require_method(
6060

6161
INFO("Looking for method: " << method_name);
6262
std::ostringstream found_methods;
63-
for(const auto entry : parsed_class.methods)
63+
for(const auto &entry : parsed_class.methods)
6464
{
6565
found_methods << id2string(entry.name) << std::endl;
6666
}
@@ -80,7 +80,7 @@ void require_parse_tree::require_instructions_match_expectation(
8080
{
8181
REQUIRE(instructions.size() == expected_instructions.size());
8282
auto actual_instruction_it = instructions.begin();
83-
for(const auto expected_instruction : expected_instructions)
83+
for(const auto &expected_instruction : expected_instructions)
8484
{
8585
expected_instruction.require_instructions_equal(*actual_instruction_it);
8686
++actual_instruction_it;

0 commit comments

Comments
 (0)