Skip to content

Commit

Permalink
Replace do-while loop with equally valid while loop
Browse files Browse the repository at this point in the history
It's slightly easier to read a while loop, and it makes sense to
initialise any_new_methods to true because we have already put things
into method_worklist2.
  • Loading branch information
Owen Jones committed Apr 19, 2018
1 parent 3e2ab6f commit b7d70e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/java_bytecode/ci_lazy_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ bool ci_lazy_methodst::operator()(
std::set<irep_idt> methods_already_populated;
std::vector<const code_function_callt *> virtual_callsites;

bool any_new_methods=false;
do
bool any_new_methods = true;
while(any_new_methods)
{
any_new_methods=false;
while(!method_worklist2.empty())
Expand Down Expand Up @@ -182,7 +182,6 @@ bool ci_lazy_methodst::operator()(
function, instantiated_classes, method_worklist2, symbol_table);
}
}
while(any_new_methods);

// Remove symbols for methods that were declared but never used:
symbol_tablet keep_symbols;
Expand Down

0 comments on commit b7d70e7

Please sign in to comment.