REFACTOR: Convert 'if' statement to 'switch' statement.

This commit is contained in:
2017-12-21 04:43:29 +00:00
parent df2fb651e4
commit 9cd1869d1d
55 changed files with 4429 additions and 4192 deletions

View File

@@ -927,10 +927,10 @@ namespace DiscImageChef.DiscImages
break;
}
case SectorTagType.CdSectorSubchannel:
if(_track.TrackSubchannelType == TrackSubchannelType.None)
throw new ArgumentException("Unsupported tag requested for this track", nameof(tag));
if(_track.TrackSubchannelType == TrackSubchannelType.Q16Interleaved)
throw new ArgumentException("Q16 subchannel not yet supported");
switch(_track.TrackSubchannelType) {
case TrackSubchannelType.None: throw new ArgumentException("Unsupported tag requested for this track", nameof(tag));
case TrackSubchannelType.Q16Interleaved: throw new ArgumentException("Q16 subchannel not yet supported");
}
sectorOffset = 2352;
sectorSize = 96;
@@ -968,10 +968,10 @@ namespace DiscImageChef.DiscImages
break;
}
case SectorTagType.CdSectorSubchannel:
if(_track.TrackSubchannelType == TrackSubchannelType.None)
throw new ArgumentException("Unsupported tag requested for this track", nameof(tag));
if(_track.TrackSubchannelType == TrackSubchannelType.Q16Interleaved)
throw new ArgumentException("Q16 subchannel not yet supported");
switch(_track.TrackSubchannelType) {
case TrackSubchannelType.None: throw new ArgumentException("Unsupported tag requested for this track", nameof(tag));
case TrackSubchannelType.Q16Interleaved: throw new ArgumentException("Q16 subchannel not yet supported");
}
sectorOffset = 2352;
sectorSize = 96;
@@ -987,10 +987,10 @@ namespace DiscImageChef.DiscImages
switch(tag)
{
case SectorTagType.CdSectorSubchannel:
if(_track.TrackSubchannelType == TrackSubchannelType.None)
throw new ArgumentException("Unsupported tag requested for this track", nameof(tag));
if(_track.TrackSubchannelType == TrackSubchannelType.Q16Interleaved)
throw new ArgumentException("Q16 subchannel not yet supported");
switch(_track.TrackSubchannelType) {
case TrackSubchannelType.None: throw new ArgumentException("Unsupported tag requested for this track", nameof(tag));
case TrackSubchannelType.Q16Interleaved: throw new ArgumentException("Q16 subchannel not yet supported");
}
sectorOffset = 2352;
sectorSize = 96;