mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] Convert into ?: operator.
This commit is contained in:
@@ -479,10 +479,9 @@ sealed partial class Dump
|
|||||||
// Sometimes drive returns a pregap here but MSF 00:02:3x => FRAME 3x (hexadecimal 0x20 to 0x27)
|
// Sometimes drive returns a pregap here but MSF 00:02:3x => FRAME 3x (hexadecimal 0x20 to 0x27)
|
||||||
bcdSubchannel = (tmpBuf[21] & 0x30) > 0;
|
bcdSubchannel = (tmpBuf[21] & 0x30) > 0;
|
||||||
|
|
||||||
if(bcdSubchannel)
|
UpdateStatus?.Invoke(bcdSubchannel
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_returns_subchannel_in_BCD);
|
? Localization.Core.Drive_returns_subchannel_in_BCD
|
||||||
else
|
: Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,9 +1083,8 @@ sealed partial class Dump
|
|||||||
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
||||||
|
|
||||||
if(_resume.NextBlock < blocks)
|
if(_resume.NextBlock < blocks)
|
||||||
{
|
for(ulong i = _resume.NextBlock; i < blocks; i++)
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i);
|
subchannelExtents.Add((int)i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
@@ -1512,9 +1510,8 @@ sealed partial class Dump
|
|||||||
supportsLongSectors);
|
supportsLongSectors);
|
||||||
|
|
||||||
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
||||||
{
|
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++)
|
||||||
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e);
|
subchannelExtents.Remove((int)e);
|
||||||
}
|
|
||||||
|
|
||||||
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -757,10 +757,9 @@ partial class Dump
|
|||||||
// Set speed
|
// Set speed
|
||||||
if(_speedMultiplier >= 0)
|
if(_speedMultiplier >= 0)
|
||||||
{
|
{
|
||||||
if(_speed == 0)
|
UpdateStatus?.Invoke(_speed == 0
|
||||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_MAX);
|
? Localization.Core.Setting_speed_to_MAX
|
||||||
else
|
: string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
|
||||||
|
|
||||||
_speed *= _speedMultiplier;
|
_speed *= _speedMultiplier;
|
||||||
|
|
||||||
|
|||||||
@@ -428,10 +428,9 @@ partial class Dump
|
|||||||
// Set speed
|
// Set speed
|
||||||
if(_speedMultiplier >= 0)
|
if(_speedMultiplier >= 0)
|
||||||
{
|
{
|
||||||
if(_speed == 0)
|
UpdateStatus?.Invoke(_speed == 0
|
||||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_MAX);
|
? Localization.Core.Setting_speed_to_MAX
|
||||||
else
|
: string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
|
||||||
|
|
||||||
_speed *= _speedMultiplier;
|
_speed *= _speedMultiplier;
|
||||||
|
|
||||||
@@ -1089,9 +1088,8 @@ partial class Dump
|
|||||||
List<ulong> tmpList = [];
|
List<ulong> tmpList = [];
|
||||||
|
|
||||||
foreach(ulong ur in _resume.BadBlocks)
|
foreach(ulong ur in _resume.BadBlocks)
|
||||||
{
|
for(ulong i = ur; i < ur + blocksToRead; i++)
|
||||||
for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i);
|
tmpList.Add(i);
|
||||||
}
|
|
||||||
|
|
||||||
tmpList.Sort();
|
tmpList.Sort();
|
||||||
|
|
||||||
|
|||||||
@@ -102,14 +102,9 @@ public partial class Device
|
|||||||
else
|
else
|
||||||
buffer = [];
|
buffer = [];
|
||||||
|
|
||||||
if(!inhibitDma)
|
LastError = !inhibitDma
|
||||||
{
|
? SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.In, out duration, out sense)
|
||||||
LastError = SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.In, out duration, out sense);
|
: SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.None, out duration, out sense);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LastError = SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.None, out duration, out sense);
|
|
||||||
}
|
|
||||||
|
|
||||||
Error = LastError != 0;
|
Error = LastError != 0;
|
||||||
|
|
||||||
@@ -180,14 +175,9 @@ public partial class Device
|
|||||||
else
|
else
|
||||||
buffer = [];
|
buffer = [];
|
||||||
|
|
||||||
if(!inhibitDma)
|
LastError = !inhibitDma
|
||||||
{
|
? SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.In, out duration, out sense)
|
||||||
LastError = SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.In, out duration, out sense);
|
: SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.None, out duration, out sense);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LastError = SendScsiCommand(cdb, ref buffer, timeout, ScsiDirection.None, out duration, out sense);
|
|
||||||
}
|
|
||||||
|
|
||||||
Error = LastError != 0;
|
Error = LastError != 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user