mirror of
https://github.com/aaru-dps/Aaru.CommonTypes.git
synced 2025-12-16 19:24:30 +00:00
Invert 'if' statements to reduce nesting.
This commit is contained in:
@@ -57,16 +57,15 @@ public static partial class MediaTypeFromDevice
|
||||
return pcmcia ? MediaType.PCCardTypeI : MediaType.GENERIC_HDD;
|
||||
}
|
||||
|
||||
if(manufacturer.ToLowerInvariant() == "syquest" &&
|
||||
model.ToLowerInvariant() == "sparq" &&
|
||||
blocks == 1961069)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Media detection",
|
||||
"Drive manufacturer is SyQuest, media has 1961069 blocks of 512 bytes, setting media type to SparQ.");
|
||||
if(manufacturer.ToLowerInvariant() != "syquest" ||
|
||||
model.ToLowerInvariant() != "sparq" ||
|
||||
blocks != 1961069)
|
||||
return MediaType.Unknown;
|
||||
|
||||
return MediaType.SparQ;
|
||||
}
|
||||
AaruConsole.DebugWriteLine("Media detection",
|
||||
"Drive manufacturer is SyQuest, media has 1961069 blocks of 512 bytes, setting media type to SparQ.");
|
||||
|
||||
return MediaType.SparQ;
|
||||
|
||||
return MediaType.Unknown;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user