Fix IDE0057
This commit is contained in:
committed by
Pavel Penev
parent
5254348819
commit
023d80b94d
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
var name = s.ReadASCII(16);
|
||||
var pos = name.IndexOf('\0');
|
||||
if (pos != 0)
|
||||
name = name.Substring(0, pos);
|
||||
name = name[..pos];
|
||||
|
||||
Filename = string.Concat(name, ".wav");
|
||||
Offset = s.ReadUInt32();
|
||||
|
||||
@@ -46,11 +46,11 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var index = filePath.IndexOfAny(DirectorySeparators, startIndex);
|
||||
if (index == -1)
|
||||
{
|
||||
parts.Add(filePath.Substring(startIndex));
|
||||
parts.Add(filePath[startIndex..]);
|
||||
break;
|
||||
}
|
||||
|
||||
parts.Add(filePath.Substring(startIndex, index - startIndex + 1));
|
||||
parts.Add(filePath[startIndex..index]);
|
||||
startIndex = index + 1;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
else
|
||||
{
|
||||
if (dir[^1] == Path.DirectorySeparatorChar || dir[^1] == Path.AltDirectorySeparatorChar)
|
||||
dir = dir.Substring(0, dir.Length - 1);
|
||||
dir = dir[..^1];
|
||||
foreach (var subDir in Directory.EnumerateDirectories(basePath, dir, SearchOption.TopDirectoryOnly))
|
||||
foreach (var s in Expand(subDir, dirs, dirIndex + 1, file))
|
||||
yield return s;
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
|
||||
public override void ReadPacks(IniFile file, string filename)
|
||||
{
|
||||
using (var s = File.OpenRead(filename.Substring(0, filename.Length - 4) + ".bin"))
|
||||
using (var s = File.OpenRead(filename[..^4] + ".bin"))
|
||||
UnpackTileData(s);
|
||||
|
||||
ReadOverlay(file);
|
||||
|
||||
Reference in New Issue
Block a user