Skip to content

Commit b7d70e7

Browse files
author
Owen Jones
committed
Replace do-while loop with equally valid while loop
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.
1 parent 3e2ab6f commit b7d70e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/java_bytecode/ci_lazy_methods.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ bool ci_lazy_methodst::operator()(
132132
std::set<irep_idt> methods_already_populated;
133133
std::vector<const code_function_callt *> virtual_callsites;
134134

135-
bool any_new_methods=false;
136-
do
135+
bool any_new_methods = true;
136+
while(any_new_methods)
137137
{
138138
any_new_methods=false;
139139
while(!method_worklist2.empty())
@@ -182,7 +182,6 @@ bool ci_lazy_methodst::operator()(
182182
function, instantiated_classes, method_worklist2, symbol_table);
183183
}
184184
}
185-
while(any_new_methods);
186185

187186
// Remove symbols for methods that were declared but never used:
188187
symbol_tablet keep_symbols;

0 commit comments

Comments
 (0)