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

@@ -658,12 +658,16 @@ namespace DiscImageChef.Core.Devices.Dumping
Statistics.AddFilesystem(plugin.XmlFSType.Type);
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
if(plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
if(plugin.XmlFSType.Type == "PC Engine filesystem")
dskType = MediaType.SuperCDROM2;
if(plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
if(plugin.XmlFSType.Type == "Nintendo Gamecube filesystem")
dskType = MediaType.GOD;
switch(plugin.XmlFSType.Type) {
case "Opera": dskType = MediaType.ThreeDO;
break;
case "PC Engine filesystem": dskType = MediaType.SuperCDROM2;
break;
case "Nintendo Wii filesystem": dskType = MediaType.WOD;
break;
case "Nintendo Gamecube filesystem": dskType = MediaType.GOD;
break;
}
}
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
@@ -696,10 +700,16 @@ namespace DiscImageChef.Core.Devices.Dumping
Statistics.AddFilesystem(plugin.XmlFSType.Type);
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
if(plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
if(plugin.XmlFSType.Type == "PC Engine filesystem") dskType = MediaType.SuperCDROM2;
if(plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
if(plugin.XmlFSType.Type == "Nintendo Gamecube filesystem") dskType = MediaType.GOD;
switch(plugin.XmlFSType.Type) {
case "Opera": dskType = MediaType.ThreeDO;
break;
case "PC Engine filesystem": dskType = MediaType.SuperCDROM2;
break;
case "Nintendo Wii filesystem": dskType = MediaType.WOD;
break;
case "Nintendo Gamecube filesystem": dskType = MediaType.GOD;
break;
}
}
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body