REFACTOR: Use string interpolation expression.

This commit is contained in:
2017-12-21 17:58:51 +00:00
parent a895700757
commit 4e6e8f340a
182 changed files with 766 additions and 1256 deletions

View File

@@ -299,7 +299,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;
@@ -312,9 +312,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];
@@ -370,8 +368,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
{
@@ -399,7 +396,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");