Invert 'if' statement to reduce nesting.

This commit is contained in:
2023-10-04 07:39:20 +01:00
parent 3429b9012b
commit 29c9f29554
2 changed files with 17 additions and 17 deletions

View File

@@ -205,14 +205,14 @@ public static class CdChecksums
// channel[0x00C], channel[0x00D], channel[0x00E]);
for(var i = 0x010; i < 0x930; i++)
{
if(channel[i] != 0x00)
{
AaruConsole.DebugWriteLine(MODULE_NAME,
"Mode 0 sector with error at address: {0:X2}:{1:X2}:{2:X2}",
channel[0x00C], channel[0x00D], channel[0x00E]);
if(channel[i] == 0x00)
continue;
return false;
}
AaruConsole.DebugWriteLine(MODULE_NAME,
"Mode 0 sector with error at address: {0:X2}:{1:X2}:{2:X2}",
channel[0x00C], channel[0x00D], channel[0x00E]);
return false;
}
return true;

View File

@@ -443,11 +443,11 @@ public class ReedSolomon
for(j = 1; j <= noEras; j++)
{
if(reg[j] != _a0)
{
reg[j] = Modnn(reg[j] + j);
q ^= _alphaTo[reg[j]];
}
if(reg[j] == _a0)
continue;
reg[j] = Modnn(reg[j] + j);
q ^= _alphaTo[reg[j]];
}
if(q != 0)
@@ -570,11 +570,11 @@ public class ReedSolomon
for(j = degLambda; j > 0; j--)
{
if(reg[j] != _a0)
{
reg[j] = Modnn(reg[j] + j);
q ^= _alphaTo[reg[j]];
}
if(reg[j] == _a0)
continue;
reg[j] = Modnn(reg[j] + j);
q ^= _alphaTo[reg[j]];
}
if(q != 0)