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

@@ -58,7 +58,7 @@ public sealed partial class OperaFS
}
string cutPath = path.StartsWith("/", StringComparison.Ordinal)
? path.Substring(1).ToLower(CultureInfo.CurrentUICulture)
? path[1..].ToLower(CultureInfo.CurrentUICulture)
: path.ToLower(CultureInfo.CurrentUICulture);
if(_directoryCache.TryGetValue(cutPath, out Dictionary<string, DirectoryEntryWithPointers> currentDirectory))

View File

@@ -187,7 +187,7 @@ public sealed partial class OperaFS
entry = null;
string cutPath = path.StartsWith("/", StringComparison.Ordinal)
? path.Substring(1).ToLower(CultureInfo.CurrentUICulture)
? path[1..].ToLower(CultureInfo.CurrentUICulture)
: path.ToLower(CultureInfo.CurrentUICulture);
string[] pieces = cutPath.Split(new[]