mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Replace if statement with null-propagating code.
This commit is contained in:
@@ -212,10 +212,9 @@ namespace DiscImageChef.Filters
|
||||
|
||||
public override string GetFilename()
|
||||
{
|
||||
if(basePath == null) return null;
|
||||
if(basePath.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase))
|
||||
if(basePath?.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 4);
|
||||
if(basePath.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase))
|
||||
if(basePath?.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 6);
|
||||
|
||||
return basePath;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -195,10 +195,9 @@ namespace DiscImageChef.Filters
|
||||
|
||||
public override string GetFilename()
|
||||
{
|
||||
if(basePath == null) return null;
|
||||
if(basePath.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase))
|
||||
if(basePath?.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 3);
|
||||
if(basePath.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase))
|
||||
if(basePath?.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 5);
|
||||
|
||||
return basePath;
|
||||
|
||||
@@ -237,10 +237,9 @@ namespace DiscImageChef.Filters
|
||||
|
||||
public override string GetFilename()
|
||||
{
|
||||
if(basePath == null) return null;
|
||||
if(basePath.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase))
|
||||
if(basePath?.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 3);
|
||||
if(basePath.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase))
|
||||
if(basePath?.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return basePath.Substring(0, basePath.Length - 5);
|
||||
|
||||
return basePath;
|
||||
|
||||
Reference in New Issue
Block a user