Skip to content

Commit c5cbcec

Browse files
committed
Fix instances where copying was being used instead of moving.
1 parent 52a669f commit c5cbcec

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

jbmc/src/java_bytecode/java_bytecode_parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ java_bytecode_parse(std::istream &istream, message_handlert &message_handler)
17021702
return {};
17031703
}
17041704

1705-
return java_bytecode_parser.parse_tree;
1705+
return std::move(java_bytecode_parser.parse_tree);
17061706
}
17071707

17081708
optionalt<class java_bytecode_parse_treet>

jbmc/src/java_bytecode/java_class_loader.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ java_class_loadert::get_parse_tree(
133133
optionalt<java_bytecode_parse_treet> parse_tree =
134134
get_class_from_jar(class_name, jar_file, *index, class_loader_limit);
135135
if(parse_tree)
136-
parse_trees.push_back(*parse_tree);
136+
parse_trees.push_back(std::move(*parse_tree));
137137
}
138138

139139
// Then add core models
@@ -153,7 +153,7 @@ java_class_loadert::get_parse_tree(
153153
optionalt<java_bytecode_parse_treet> parse_tree =
154154
get_class_from_jar(class_name, core_models, *index, class_loader_limit);
155155
if(parse_tree)
156-
parse_trees.push_back(*parse_tree);
156+
parse_trees.push_back(std::move(*parse_tree));
157157
}
158158
}
159159

@@ -168,7 +168,7 @@ java_class_loadert::get_parse_tree(
168168
optionalt<java_bytecode_parse_treet> parse_tree =
169169
get_class_from_jar(class_name, cp_entry, *index, class_loader_limit);
170170
if(parse_tree)
171-
parse_trees.push_back(*parse_tree);
171+
parse_trees.push_back(std::move(*parse_tree));
172172
}
173173
else
174174
{

jbmc/unit/java_bytecode/java_bytecode_parse_lambdas/java_bytecode_parse_lambda_method_table.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SCENARIO(
4141
{
4242
REQUIRE(parse_tree);
4343
REQUIRE(parse_tree->loading_successful);
44-
const java_bytecode_parse_treet::classt parsed_class =
44+
const java_bytecode_parse_treet::classt &parsed_class =
4545
parse_tree->parsed_class;
4646
REQUIRE(parsed_class.attribute_bootstrapmethods_read);
4747
REQUIRE(parsed_class.lambda_method_handle_map.size() == 12);
@@ -352,7 +352,7 @@ SCENARIO(
352352
{
353353
REQUIRE(parse_tree);
354354
REQUIRE(parse_tree->loading_successful);
355-
const java_bytecode_parse_treet::classt parsed_class =
355+
const java_bytecode_parse_treet::classt &parsed_class =
356356
parse_tree->parsed_class;
357357
REQUIRE(parsed_class.attribute_bootstrapmethods_read);
358358
REQUIRE(parsed_class.lambda_method_handle_map.size() == 12);
@@ -661,7 +661,7 @@ SCENARIO(
661661
{
662662
REQUIRE(parse_tree);
663663
REQUIRE(parse_tree->loading_successful);
664-
const java_bytecode_parse_treet::classt parsed_class =
664+
const java_bytecode_parse_treet::classt &parsed_class =
665665
parse_tree->parsed_class;
666666
REQUIRE(parsed_class.attribute_bootstrapmethods_read);
667667
REQUIRE(parsed_class.lambda_method_handle_map.size() == 12);
@@ -996,7 +996,7 @@ SCENARIO(
996996
{
997997
REQUIRE(parse_tree);
998998
REQUIRE(parse_tree->loading_successful);
999-
const java_bytecode_parse_treet::classt parsed_class =
999+
const java_bytecode_parse_treet::classt &parsed_class =
10001000
parse_tree->parsed_class;
10011001
REQUIRE(parsed_class.attribute_bootstrapmethods_read);
10021002
REQUIRE(parsed_class.lambda_method_handle_map.size() == 3);

0 commit comments

Comments
 (0)