Skip to content

Commit

Permalink
Merge pull request #2435 from tautschnig/vs-ranged-for
Browse files Browse the repository at this point in the history
Change index variable name, simplify code
  • Loading branch information
tautschnig authored Jul 8, 2018
2 parents be7159a + 44cc033 commit d393d1c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/goto-programs/goto_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,12 @@ void goto_convertt::finish_gotos(goto_programt &dest, const irep_idt &mode)
// for C++ non-pod types and impossible in Java in any case.
auto goto_stack=g_it.second;
const auto &label_stack=l_it->second.second;
bool stack_is_prefix=true;
if(label_stack.size()>goto_stack.size())
stack_is_prefix=false;
for(std::size_t i=0, ilim=label_stack.size();
i!=ilim && stack_is_prefix;
++i)
bool stack_is_prefix = label_stack.size() <= goto_stack.size();
for(
std::size_t idx = 0, ilim = label_stack.size();
idx != ilim && stack_is_prefix; ++idx)
{
if(goto_stack[i]!=label_stack[i])
stack_is_prefix=false;
stack_is_prefix &= goto_stack[idx] == label_stack[idx];
}

if(!stack_is_prefix)
Expand Down

0 comments on commit d393d1c

Please sign in to comment.