Skip to content

Commit 847211c

Browse files
Avoid unnecessary copies in java_types.cpp
Without the & we are copying the items we are iterating over, which is unnecessary here.
1 parent 2f448dc commit 847211c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jbmc/src/java_bytecode/java_types.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ void get_dependencies_from_generic_parameters_rec(
946946
// Java generic type that holds different types in its type arguments
947947
if(is_java_generic_type(t))
948948
{
949-
for(const auto type_arg : to_java_generic_type(t).generic_type_arguments())
949+
for(const auto &type_arg : to_java_generic_type(t).generic_type_arguments())
950950
get_dependencies_from_generic_parameters_rec(type_arg, refs);
951951
}
952952

@@ -1126,7 +1126,7 @@ std::string pretty_signature(const java_method_typet &method_type)
11261126
result << '(';
11271127

11281128
bool first = true;
1129-
for(const auto p : method_type.parameters())
1129+
for(const auto &p : method_type.parameters())
11301130
{
11311131
if(p.get_this())
11321132
continue;

0 commit comments

Comments
 (0)