REFACTOR: Replace if statement with null-propagating code.

This commit is contained in:
2017-12-21 17:45:39 +00:00
parent 3053d22b91
commit a895700757
42 changed files with 91 additions and 172 deletions

View File

@@ -221,10 +221,9 @@ namespace DiscImageChef.Filters
public override string GetFilename()
{
if(basePath == null) return null;
if(basePath.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase))
if(basePath?.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase) == true)
return basePath.Substring(0, basePath.Length - 3);
if(basePath.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase))
if(basePath?.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase) == true)
return basePath.Substring(0, basePath.Length - 5);
return basePath;