inst_gen: Compress loop into std::any_of in IsInvalidInstruction()
Same behavior, but using a more self-documenting function.
This commit is contained in:
parent
a665470545
commit
1bfac4aed0
@ -4,6 +4,7 @@
|
||||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
@ -23,10 +24,8 @@ public:
|
||||
}
|
||||
|
||||
static bool IsInvalidInstruction(u32 inst) {
|
||||
for (const auto& invalid : invalid_instructions)
|
||||
if (invalid.Match(inst))
|
||||
return true;
|
||||
return false;
|
||||
return std::any_of(invalid_instructions.begin(), invalid_instructions.end(),
|
||||
[inst](const auto& invalid) { return invalid.Match(inst); });
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user