Use range indexers.

This commit is contained in:
2022-11-14 01:15:06 +00:00
parent e0508f096c
commit 6a4dea75ea
23 changed files with 65 additions and 64 deletions

View File

@@ -56,7 +56,7 @@ public sealed partial class XboxFatPlugin
return ErrorNumber.NoError;
}
string cutPath = path.StartsWith('/') ? path.Substring(1).ToLower(_cultureInfo) : path.ToLower(_cultureInfo);
string cutPath = path.StartsWith('/') ? path[1..].ToLower(_cultureInfo) : path.ToLower(_cultureInfo);
if(_directoryCache.TryGetValue(cutPath, out Dictionary<string, DirectoryEntry> currentDirectory))
{

View File

@@ -252,7 +252,7 @@ public sealed partial class XboxFatPlugin
{
entry = new DirectoryEntry();
string cutPath = path.StartsWith('/') ? path.Substring(1).ToLower(_cultureInfo) : path.ToLower(_cultureInfo);
string cutPath = path.StartsWith('/') ? path[1..].ToLower(_cultureInfo) : path.ToLower(_cultureInfo);
string[] pieces = cutPath.Split(new[]
{