Skip to content

Commit dfa3ffd

Browse files
committed
TG-672 Replaced push_back with emplace_back
1 parent ac1b620 commit dfa3ffd

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/solvers/refinement/string_refinement.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ void string_refinementt::set_to(const exprt &expr, bool value)
608608
// If lhs is not a symbol, let supert::set_to() handle it.
609609
if(lhs.id()!=ID_symbol)
610610
{
611-
non_string_axioms.push_back(std::make_pair(expr, value));
611+
non_string_axioms.emplace_back(expr, value);
612612
return;
613613
}
614614

@@ -663,16 +663,15 @@ void string_refinementt::set_to(const exprt &expr, bool value)
663663

664664
// Push the substituted equality to the list of axioms to be given to
665665
// supert::set_to.
666-
non_string_axioms.push_back(
667-
std::make_pair(equal_exprt(lhs, subst_rhs), value));
666+
non_string_axioms.emplace_back(equal_exprt(lhs, subst_rhs), value);
668667
}
669668
// Push the unmodified equality to the list of axioms to be given to
670669
// supert::set_to.
671670
else
672671
{
673672
// TODO: Verify that the expression contains no string.
674673
// This will be easy once exprt iterators will have been implemented.
675-
non_string_axioms.push_back(std::make_pair(expr, value));
674+
non_string_axioms.emplace_back(expr, value);
676675
}
677676
}
678677

@@ -1546,7 +1545,7 @@ static std::map<exprt, int> map_representation_of_sum(const exprt &f)
15461545
std::map<exprt, int> elems;
15471546

15481547
std::list<std::pair<exprt, bool> > to_process;
1549-
to_process.push_back(std::make_pair(f, true));
1548+
to_process.emplace_back(f, true);
15501549

15511550
while(!to_process.empty())
15521551
{
@@ -1556,16 +1555,16 @@ static std::map<exprt, int> map_representation_of_sum(const exprt &f)
15561555
if(cur.id()==ID_plus)
15571556
{
15581557
for(const auto &op : cur.operands())
1559-
to_process.push_back(std::make_pair(op, positive));
1558+
to_process.emplace_back(op, positive);
15601559
}
15611560
else if(cur.id()==ID_minus)
15621561
{
1563-
to_process.push_back(std::make_pair(cur.op1(), !positive));
1564-
to_process.push_back(std::make_pair(cur.op0(), positive));
1562+
to_process.emplace_back(cur.op1(), !positive);
1563+
to_process.emplace_back(cur.op0(), positive);
15651564
}
15661565
else if(cur.id()==ID_unary_minus)
15671566
{
1568-
to_process.push_back(std::make_pair(cur.op0(), !positive));
1567+
to_process.emplace_back(cur.op0(), !positive);
15691568
}
15701569
else
15711570
{

0 commit comments

Comments
 (0)