Skip to content

Commit 560d712

Browse files
Declare constants as const
1 parent 35422f3 commit 560d712

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/goto-instrument/cover_instrument_location.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ void cover_location_instrumentert::instrument(
2222
if(is_non_cover_assertion(i_it))
2323
i_it->make_skip();
2424

25-
unsigned block_nr = basic_blocks.block_of(i_it);
25+
const unsigned block_nr = basic_blocks.block_of(i_it);
2626
const auto representative_instruction = basic_blocks.instruction_of(block_nr);
2727
// we only instrument the selected instruction
2828
if(representative_instruction && *representative_instruction == i_it)
2929
{
30-
std::string b = std::to_string(block_nr + 1); // start with 1
31-
std::string id = id2string(i_it->function) + "#" + b;
32-
source_locationt source_location =
33-
basic_blocks.source_location_of(block_nr);
30+
const std::string b = std::to_string(block_nr + 1); // start with 1
31+
const std::string id = id2string(i_it->function) + "#" + b;
32+
const auto source_location = basic_blocks.source_location_of(block_nr);
3433

3534
// filter goals
3635
if(goal_filters(source_location))
3736
{
38-
std::string comment = "block " + b;
37+
const std::string comment = "block " + b;
3938
const irep_idt function = i_it->function;
4039
goto_program.insert_before_swap(i_it);
4140
i_it->make_assertion(false_exprt());

0 commit comments

Comments
 (0)