mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Convert if to switch statement.
This commit is contained in:
27
MMC/CSD.cs
27
MMC/CSD.cs
@@ -421,14 +421,25 @@ public static partial class Decoders
|
||||
|
||||
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2) * Math.Pow(2, csd.ReadBlockLength);
|
||||
|
||||
if(result > 1073741824)
|
||||
sb.AppendFormat("\tDevice has {0} GiB", result / 1073741824.0).AppendLine();
|
||||
else if(result > 1048576)
|
||||
sb.AppendFormat("\tDevice has {0} MiB", result / 1048576.0).AppendLine();
|
||||
else if(result > 1024)
|
||||
sb.AppendFormat("\tDevice has {0} KiB", result / 1024.0).AppendLine();
|
||||
else
|
||||
sb.AppendFormat("\tDevice has {0} bytes", result).AppendLine();
|
||||
switch(result)
|
||||
{
|
||||
case > 1073741824:
|
||||
sb.AppendFormat("\tDevice has {0} GiB", result / 1073741824.0).AppendLine();
|
||||
|
||||
break;
|
||||
case > 1048576:
|
||||
sb.AppendFormat("\tDevice has {0} MiB", result / 1048576.0).AppendLine();
|
||||
|
||||
break;
|
||||
case > 1024:
|
||||
sb.AppendFormat("\tDevice has {0} KiB", result / 1024.0).AppendLine();
|
||||
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tDevice has {0} bytes", result).AppendLine();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
switch(csd.ReadCurrentAtVddMin & 0x07)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user