mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use range indexers.
This commit is contained in:
@@ -211,10 +211,10 @@ public class BZip2 : IFilter
|
||||
get
|
||||
{
|
||||
if(BasePath?.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return BasePath.Substring(0, BasePath.Length - 4);
|
||||
return BasePath[..^4];
|
||||
|
||||
return BasePath?.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase) == true
|
||||
? BasePath.Substring(0, BasePath.Length - 6) : BasePath;
|
||||
return BasePath?.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase) == true ? BasePath[..^6]
|
||||
: BasePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,10 +210,10 @@ public sealed class GZip : IFilter
|
||||
get
|
||||
{
|
||||
if(BasePath?.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return BasePath.Substring(0, BasePath.Length - 3);
|
||||
return BasePath[..^3];
|
||||
|
||||
return BasePath?.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase) == true
|
||||
? BasePath.Substring(0, BasePath.Length - 5) : BasePath;
|
||||
return BasePath?.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase) == true ? BasePath[..^5]
|
||||
: BasePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,10 +179,10 @@ public sealed class LZip : IFilter
|
||||
get
|
||||
{
|
||||
if(BasePath?.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return BasePath.Substring(0, BasePath.Length - 3);
|
||||
return BasePath[..^3];
|
||||
|
||||
return BasePath?.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase) == true
|
||||
? BasePath.Substring(0, BasePath.Length - 5) : BasePath;
|
||||
return BasePath?.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase) == true ? BasePath[..^5]
|
||||
: BasePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -184,10 +184,10 @@ public sealed class XZ : IFilter
|
||||
get
|
||||
{
|
||||
if(BasePath?.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||
return BasePath.Substring(0, BasePath.Length - 3);
|
||||
return BasePath[..^3];
|
||||
|
||||
return BasePath?.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase) == true
|
||||
? BasePath.Substring(0, BasePath.Length - 5) : BasePath;
|
||||
return BasePath?.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase) == true ? BasePath[..^5]
|
||||
: BasePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user