Skip to content

Commit c1045aa

Browse files
Use [] instead of at on vector
The index is checked against the size before end so there is no need to use at there.
1 parent 6811238 commit c1045aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/goto-instrument/cover_basic_blocks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ optionalt<goto_programt::const_targett>
9898
cover_basic_blockst::instruction_of(const std::size_t block_nr) const
9999
{
100100
INVARIANT(block_nr < block_infos.size(), "block number out of range");
101-
return block_infos.at(block_nr).representative_inst;
101+
return block_infos[block_nr].representative_inst;
102102
}
103103

104104
const source_locationt &
105105
cover_basic_blockst::source_location_of(const std::size_t block_nr) const
106106
{
107107
INVARIANT(block_nr < block_infos.size(), "block number out of range");
108-
return block_infos.at(block_nr).source_location;
108+
return block_infos[block_nr].source_location;
109109
}
110110

111111
void cover_basic_blockst::report_block_anomalies(

0 commit comments

Comments
 (0)