mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Invert 'if' statement to reduce nesting.
This commit is contained in:
@@ -290,18 +290,15 @@ namespace DiscImageChef.Decoders.Floppy
|
||||
|
||||
public static byte[] DecodeSector(RawSector sector)
|
||||
{
|
||||
if(sector.addressField.prologue[0] == 0xD5 && sector.addressField.prologue[1] == 0xAA)
|
||||
{
|
||||
// Pre DOS 3.3
|
||||
if(sector.addressField.prologue[2] == 0xB5) return Decode5and3(sector.dataField.data);
|
||||
// DOS 3.3
|
||||
if(sector.addressField.prologue[2] == 0x96) return Decode6and2(sector.dataField.data);
|
||||
// Unknown
|
||||
return null;
|
||||
}
|
||||
if(sector.addressField.prologue[0] != 0xD5 || sector.addressField.prologue[1] != 0xAA) return null;
|
||||
// Pre DOS 3.3
|
||||
if(sector.addressField.prologue[2] == 0xB5) return Decode5and3(sector.dataField.data);
|
||||
// DOS 3.3
|
||||
if(sector.addressField.prologue[2] == 0x96) return Decode6and2(sector.dataField.data);
|
||||
// Unknown
|
||||
return null;
|
||||
|
||||
// Not Apple ][ GCR?
|
||||
return null;
|
||||
}
|
||||
|
||||
public static RawSector MarshalSector(byte[] data, int offset = 0)
|
||||
|
||||
Reference in New Issue
Block a user