REFACTOR: Invert 'if' statement to reduce nesting.

This commit is contained in:
2017-12-21 06:06:19 +00:00
parent 9cd1869d1d
commit 4d886dae25
138 changed files with 9447 additions and 9806 deletions

View File

@@ -56,11 +56,10 @@ namespace DiscImageChef.Core
try
{
DicConsole.DebugWriteLine("Format detection", "Trying plugin {0}", imageplugin.Name);
if(imageplugin.IdentifyImage(imageFilter))
{
imageFormat = imageplugin;
break;
}
if(!imageplugin.IdentifyImage(imageFilter)) continue;
imageFormat = imageplugin;
break;
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { }
@@ -75,11 +74,10 @@ namespace DiscImageChef.Core
try
{
DicConsole.DebugWriteLine("Format detection", "Trying plugin {0}", imageplugin.Name);
if(imageplugin.IdentifyImage(imageFilter))
{
imageFormat = imageplugin;
break;
}
if(!imageplugin.IdentifyImage(imageFilter)) continue;
imageFormat = imageplugin;
break;
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { }