Skip to content

Use std::set instead of map as value is never used #2408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/goto-instrument/goto_program2code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,15 +775,15 @@ bool goto_program2codet::set_block_end_points(
cases_listt &cases,
std::set<unsigned> &processed_locations)
{
std::map<goto_programt::const_targett, std::size_t> targets_done;
std::set<goto_programt::const_targett> targets_done;

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

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

it->case_last=case_end;
}

targets_done[it->case_start]=1;
}

return false;
Expand Down