REFACTOR: Invert 'if' statement to reduce nesting.

This commit is contained in:
2017-12-21 06:06:19 +00:00
parent 9cd1869d1d
commit 4d886dae25
138 changed files with 9447 additions and 9806 deletions

View File

@@ -173,8 +173,11 @@ namespace DiscImageChef.Devices
}
}
if((command == (MmcCommands)SecureDigitalCommands.SendOperatingCondition ||
command == MmcCommands.SendOpCond) && cachedOcr != null)
if((command != (MmcCommands)SecureDigitalCommands.SendOperatingCondition &&
command != MmcCommands.SendOpCond) || cachedOcr == null)
return Command.SendMmcCommand(platformId, fd, command, write, isApplication, flags, argument, blockSize,
blocks, ref buffer, out response, out duration, out sense, timeout);
{
System.DateTime start = System.DateTime.Now;
buffer = new byte[cachedOcr.Length];
@@ -185,9 +188,6 @@ namespace DiscImageChef.Devices
duration = (end - start).TotalMilliseconds;
return 0;
}
return Command.SendMmcCommand(platformId, fd, command, write, isApplication, flags, argument, blockSize,
blocks, ref buffer, out response, out duration, out sense, timeout);
}
}
}