Skip to content

Commit 44cc033

Browse files
committed
Change index variable name, simplify code
The variable name "i" was already used in the context, triggering a warning with Visual Studio.
1 parent c6f9231 commit 44cc033

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/goto-programs/goto_convert.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,12 @@ void goto_convertt::finish_gotos(goto_programt &dest, const irep_idt &mode)
146146
// for C++ non-pod types and impossible in Java in any case.
147147
auto goto_stack=g_it.second;
148148
const auto &label_stack=l_it->second.second;
149-
bool stack_is_prefix=true;
150-
if(label_stack.size()>goto_stack.size())
151-
stack_is_prefix=false;
152-
for(std::size_t i=0, ilim=label_stack.size();
153-
i!=ilim && stack_is_prefix;
154-
++i)
149+
bool stack_is_prefix = label_stack.size() <= goto_stack.size();
150+
for(
151+
std::size_t idx = 0, ilim = label_stack.size();
152+
idx != ilim && stack_is_prefix; ++idx)
155153
{
156-
if(goto_stack[i]!=label_stack[i])
157-
stack_is_prefix=false;
154+
stack_is_prefix &= goto_stack[idx] == label_stack[idx];
158155
}
159156

160157
if(!stack_is_prefix)

0 commit comments

Comments
 (0)