inst_gen: Compress loop into std::any_of in IsInvalidInstruction()

Same behavior, but using a more self-documenting function.
This commit is contained in:
Lioncash 2018-07-13 09:49:53 -04:00 committed by MerryMage
parent d909b0919e
commit 7d52d7bef8

View file

@ -4,6 +4,7 @@
* General Public License version 2 or any later version. * General Public License version 2 or any later version.
*/ */
#include <algorithm>
#include <cstring> #include <cstring>
#include <vector> #include <vector>
@ -23,10 +24,8 @@ public:
} }
static bool IsInvalidInstruction(u32 inst) { static bool IsInvalidInstruction(u32 inst) {
for (const auto& invalid : invalid_instructions) return std::any_of(invalid_instructions.begin(), invalid_instructions.end(),
if (invalid.Match(inst)) [inst](const auto& invalid) { return invalid.Match(inst); });
return true;
return false;
} }
private: private: