@@ -179,8 +179,7 @@ void code_contractst::check_apply_loop_contracts(
179
179
}
180
180
else
181
181
{
182
- for (const auto &target : assigns.operands ())
183
- modifies.insert (target);
182
+ modifies.insert (assigns.operands ().cbegin (), assigns.operands ().cend ());
184
183
185
184
// Create snapshots of write set CARs.
186
185
// This must be done before havocing the write set.
@@ -269,16 +268,10 @@ void code_contractst::check_apply_loop_contracts(
269
268
loop_head--;
270
269
271
270
// Perform write set instrumentation before adding anything else to loop body.
272
- // Copy the loop_body as we would increment the iterator while instrumenting.
273
271
if (assigns.is_not_nil ())
274
272
{
275
- auto copy_loop_body = loop_body;
276
273
check_frame_conditions (
277
- function_name,
278
- goto_function.body ,
279
- copy_loop_body,
280
- loop_end,
281
- loop_assigns);
274
+ function_name, goto_function.body , loop_body, loop_end, loop_assigns);
282
275
}
283
276
284
277
// Generate: assignments to store the multidimensional decreases clause's
@@ -654,8 +647,7 @@ bool code_contractst::apply_function_contract(
654
647
655
648
// Havoc all targets in the write set
656
649
modifiest modifies;
657
- for (const auto &target : targets.operands ())
658
- modifies.insert (target);
650
+ modifies.insert (targets.operands ().cbegin (), targets.operands ().cend ());
659
651
660
652
goto_programt assigns_havoc;
661
653
havoc_assigns_targetst havoc_gen (modifies, ns);
@@ -1014,7 +1006,7 @@ bool code_contractst::check_frame_conditions_function(const irep_idt &function)
1014
1006
void code_contractst::check_frame_conditions (
1015
1007
const irep_idt &function,
1016
1008
goto_programt &body,
1017
- goto_programt::targett & instruction_it,
1009
+ goto_programt::targett instruction_it,
1018
1010
const goto_programt::targett &instruction_end,
1019
1011
assigns_clauset &assigns)
1020
1012
{
0 commit comments