Cleanup CleanSS check (#763)

* Cleanup CleanSS check

* Make ssv2 check consistent
This commit is contained in:
Deterous
2024-11-23 13:15:15 +09:00
committed by GitHub
parent 617b0ba2c5
commit 19d6006aff
2 changed files with 4 additions and 3 deletions

View File

@@ -25,6 +25,7 @@
- Replace some uses of Regex.Replace
- Clean up usings after last commit
- Version gate remaining Linq statements
- Cleanup CleanSS check
### 3.2.3 (2024-11-06)

View File

@@ -924,9 +924,9 @@ namespace MPF.Processors
#if NET20
var checkArr = new byte[72];
Array.Copy(ss, 32, checkArr, 0, 72);
if (xgdType == 3 && Array.TrueForAll(checkArr, x => x == 0))
if (xgdType == 3 && Array.Exists(checkArr, x => x != 0))
#else
if (xgdType == 3 && ss.Skip(32).Take(72).All(x => x == 0))
if (xgdType == 3 && ss.Skip(32).Take(72).Any(x => x != 0))
#endif
{
// Check for a cleaned SSv2
@@ -1082,7 +1082,7 @@ namespace MPF.Processors
#if NET20
var checkArr = new byte[72];
Array.Copy(ss, 32, checkArr, 0, 72);
bool ssv2 = !Array.TrueForAll(checkArr, x => x == 0);
bool ssv2 = Array.Exists(checkArr, x => x != 0);
#else
bool ssv2 = ss.Skip(32).Take(72).Any(x => x != 0);
#endif