mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Use string interpolation expression.
This commit is contained in:
@@ -243,8 +243,7 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
if((qHdr.features & QCOW_FEATURE_MASK) != 0)
|
||||
throw new
|
||||
ImageNotSupportedException(string.Format("Unknown incompatible features {0:X} enabled, not proceeding.",
|
||||
qHdr.features & QCOW_FEATURE_MASK));
|
||||
ImageNotSupportedException($"Unknown incompatible features {qHdr.features & QCOW_FEATURE_MASK:X} enabled, not proceeding.");
|
||||
}
|
||||
|
||||
if(qHdr.size <= 1) throw new ArgumentOutOfRangeException(nameof(qHdr.size), "Image size is too small");
|
||||
@@ -333,7 +332,7 @@ namespace DiscImageChef.DiscImages
|
||||
ImageInfo.XmlMediaType = XmlMediaType.BlockMedia;
|
||||
ImageInfo.MediaType = MediaType.GENERIC_HDD;
|
||||
ImageInfo.ImageSize = qHdr.size;
|
||||
ImageInfo.ImageVersion = string.Format("{0}", qHdr.version);
|
||||
ImageInfo.ImageVersion = $"{qHdr.version}";
|
||||
|
||||
ImageInfo.Cylinders = (uint)(ImageInfo.Sectors / 16 / 63);
|
||||
ImageInfo.Heads = 16;
|
||||
@@ -346,7 +345,7 @@ namespace DiscImageChef.DiscImages
|
||||
{
|
||||
if(sectorAddress > ImageInfo.Sectors - 1)
|
||||
throw new ArgumentOutOfRangeException(nameof(sectorAddress),
|
||||
string.Format("Sector address {0} not found", sectorAddress));
|
||||
$"Sector address {sectorAddress} not found");
|
||||
|
||||
byte[] sector;
|
||||
|
||||
@@ -359,9 +358,7 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
if((long)l1Off >= l1Table.LongLength)
|
||||
throw new ArgumentOutOfRangeException(nameof(l1Off),
|
||||
string
|
||||
.Format("Trying to read past L1 table, position {0} of a max {1}",
|
||||
l1Off, l1Table.LongLength));
|
||||
$"Trying to read past L1 table, position {l1Off} of a max {l1Table.LongLength}");
|
||||
|
||||
// TODO: Implement differential images
|
||||
if(l1Table[l1Off] == 0) return new byte[512];
|
||||
@@ -418,8 +415,7 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
if(read != clusterSize)
|
||||
throw new
|
||||
IOException(string.Format("Unable to decompress cluster, expected {0} bytes got {1}",
|
||||
clusterSize, read));
|
||||
IOException($"Unable to decompress cluster, expected {clusterSize} bytes got {read}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -447,7 +443,7 @@ namespace DiscImageChef.DiscImages
|
||||
{
|
||||
if(sectorAddress > ImageInfo.Sectors - 1)
|
||||
throw new ArgumentOutOfRangeException(nameof(sectorAddress),
|
||||
string.Format("Sector address {0} not found", sectorAddress));
|
||||
$"Sector address {sectorAddress} not found");
|
||||
|
||||
if(sectorAddress + length > ImageInfo.Sectors)
|
||||
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than available");
|
||||
|
||||
Reference in New Issue
Block a user