Convert into '?:' expression.

This commit is contained in:
2022-11-14 01:27:11 +00:00
parent 2b40eab0d2
commit ad2d0b8a24
7 changed files with 12 additions and 27 deletions

View File

@@ -237,10 +237,9 @@ public partial class Device
Error = LastError != 0;
if(transferLength > 1)
AaruConsole.DebugWriteLine("MMC Device", "READ_MULTIPLE_BLOCK took {0} ms.", duration);
else
AaruConsole.DebugWriteLine("MMC Device", "READ_SINGLE_BLOCK took {0} ms.", duration);
AaruConsole.DebugWriteLine("MMC Device",
transferLength > 1 ? "READ_MULTIPLE_BLOCK took {0} ms."
: "READ_SINGLE_BLOCK took {0} ms.", duration);
return sense;
}

View File

@@ -70,10 +70,7 @@ public partial class Device
cdb[3] = (byte)(lba & 0xFF);
cdb[4] = transferLength;
if(transferLength == 0)
buffer = new byte[256 * blockSize];
else
buffer = new byte[transferLength * blockSize];
buffer = transferLength == 0 ? new byte[256 * blockSize] : new byte[transferLength * blockSize];
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
out bool sense);