Fix RCS1257, RCS1258, RCS1261, RCS1262, RCS1265, RCS1266, RCS1267

This commit is contained in:
RoosterDragon
2024-11-25 22:19:51 +00:00
committed by Gustas Kažukauskas
parent a324af1afd
commit 1b2c119b58
23 changed files with 59 additions and 40 deletions

View File

@@ -35,7 +35,7 @@ namespace OpenRA.FileSystem
return Directory.GetFiles(Name, "*", SearchOption.TopDirectoryOnly)
.Concat(Directory.GetDirectories(Name))
.Select(Path.GetFileName)
.OrderBy(f => f);
.Order();
}
}

View File

@@ -408,7 +408,7 @@ namespace OpenRA
// Sanitize input from platform-specific launchers
// Process.Start requires paths to not be quoted, even if they contain spaces
if (launchPath != null && launchPath[0] == '"' && launchPath.Last() == '"')
if (launchPath != null && launchPath[0] == '"' && launchPath[^1] == '"')
launchPath = launchPath[1..^1];
// Metadata registration requires an explicit launch path
@@ -584,7 +584,7 @@ namespace OpenRA
Directory.CreateDirectory(directory);
var filename = TimestampedFilename(true);
var path = Path.Combine(directory, string.Concat(filename, ".png"));
var path = Path.Combine(directory, $"{filename}.png");
Log.Write("debug", "Taking screenshot " + path);
Renderer.SaveScreenshot(path);

View File

@@ -26,7 +26,7 @@ namespace OpenRA
var total = response.Content.Headers.ContentLength ?? -1;
var canReportProgress = total > 0;
using (var contentStream = await response.Content.ReadAsStreamAsync(token))
await using (var contentStream = await response.Content.ReadAsStreamAsync(token))
{
var totalRead = 0L;
var buffer = new byte[8192];