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

@@ -2038,17 +2038,17 @@ namespace DiscImageChef.DiscImages
uint sector_size;
if(tag == SectorTagType.CdSectorSubchannel)
if(track.TrackSubchannelType == TrackSubchannelType.None)
throw new FeatureNotPresentImageException("Requested sector does not contain subchannel");
else if(track.TrackSubchannelType == TrackSubchannelType.RawInterleaved)
{
sector_offset = (uint)track.TrackRawBytesPerSector;
sector_size = 96;
switch(track.TrackSubchannelType) {
case TrackSubchannelType.None: throw new FeatureNotPresentImageException("Requested sector does not contain subchannel");
case TrackSubchannelType.RawInterleaved:
sector_offset = (uint)track.TrackRawBytesPerSector;
sector_size = 96;
break;
default:
throw new
FeatureSupportedButNotImplementedImageException(string.Format("Unsupported subchannel type {0}",
track.TrackSubchannelType));
}
else
throw new
FeatureSupportedButNotImplementedImageException(string.Format("Unsupported subchannel type {0}",
track.TrackSubchannelType));
else
switch(track.TrackType)
{