Skip to content

Commit 8c2f6e1

Browse files
committed
Use std::set instead of map as value is never used
1 parent b8743fa commit 8c2f6e1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/goto-instrument/goto_program2code.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -775,15 +775,15 @@ bool goto_program2codet::set_block_end_points(
775775
cases_listt &cases,
776776
std::set<unsigned> &processed_locations)
777777
{
778-
std::map<goto_programt::const_targett, std::size_t> targets_done;
778+
std::set<goto_programt::const_targett> targets_done;
779779

780780
for(cases_listt::iterator it=cases.begin();
781781
it!=cases.end();
782782
++it)
783783
{
784784
// some branch targets may be shared by multiple branch instructions,
785785
// as in case 1: case 2: code; we build a nested code_switch_caset
786-
if(targets_done.find(it->case_start)!=targets_done.end())
786+
if(!targets_done.insert(it->case_start).second)
787787
continue;
788788

789789
// compute the block that belongs to this case
@@ -819,8 +819,6 @@ bool goto_program2codet::set_block_end_points(
819819

820820
it->case_last=case_end;
821821
}
822-
823-
targets_done[it->case_start]=1;
824822
}
825823

826824
return false;

0 commit comments

Comments
 (0)