Skip to content

Commit c58ac60

Browse files
Avoid copy in ranged for loops over expressions
1 parent beff419 commit c58ac60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/solvers/refinement/string_refinement.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,15 @@ union_find_replacet string_identifiers_resolution_from_equations(
482482
equations_to_treat.push(i);
483483

484484
std::vector<exprt> rhs_strings = extract_strings(eq.rhs());
485-
for(const auto expr : rhs_strings)
485+
for(const auto &expr : rhs_strings)
486486
equation_map.add(i, expr);
487487
}
488488
else if(eq.lhs().type().id() != ID_pointer &&
489489
has_string_subtype(eq.lhs().type()))
490490
{
491491
std::vector<exprt> lhs_strings = extract_strings_from_lhs(eq.lhs());
492492

493-
for(const auto expr : lhs_strings)
493+
for(const auto &expr : lhs_strings)
494494
equation_map.add(i, expr);
495495

496496
if(lhs_strings.empty())

0 commit comments

Comments
 (0)