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
d909b0919e
commit
7d52d7bef8
1 changed files with 3 additions and 4 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue