Merge pull request #4256 from lioncash/anyof

PPCAnalyst: Compress loop into std::any_of
This commit is contained in:
JosJuice 2016-09-29 15:47:29 +02:00 committed by GitHub
commit a714460ee3
1 changed files with 4 additions and 10 deletions

View File

@ -191,16 +191,10 @@ static void AnalyzeFunction2(Symbol* func)
{
u32 flags = func->flags;
bool nonleafcall = false;
for (const SCall& c : func->calls)
{
Symbol* called_func = g_symbolDB.GetSymbolFromAddr(c.function);
if (called_func && (called_func->flags & FFLAG_LEAF) == 0)
{
nonleafcall = true;
break;
}
}
bool nonleafcall = std::any_of(func->calls.begin(), func->calls.end(), [](const auto& call) {
const Symbol* called_func = g_symbolDB.GetSymbolFromAddr(call.function);
return called_func && (called_func->flags & FFLAG_LEAF) == 0;
});
if (nonleafcall && !(flags & FFLAG_EVIL) && !(flags & FFLAG_RFI))
flags |= FFLAG_ONLYCALLSNICELEAFS;