Fix CA1310, CA1311

This commit is contained in:
RoosterDragon
2023-03-12 15:44:49 +00:00
committed by Matthias Mailänder
parent d83e579dfe
commit 285443f10f
43 changed files with 80 additions and 67 deletions

View File

@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Cnc.AudioLoaders
{
var vfh = VocFileHeader.Read(stream);
if (!vfh.Description.StartsWith("Creative Voice File"))
if (!vfh.Description.StartsWith("Creative Voice File", StringComparison.Ordinal))
throw new InvalidDataException("Voc header description not recognized");
if (vfh.DatablockOffset != 26)
throw new InvalidDataException("Voc header offset is wrong");

View File

@@ -9,6 +9,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
@@ -111,7 +112,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
public VxlReader(Stream s)
{
if (!s.ReadASCII(16).StartsWith("Voxel Animation"))
if (!s.ReadASCII(16).StartsWith("Voxel Animation", StringComparison.Ordinal))
throw new InvalidDataException("Invalid vxl header");
s.ReadUInt32();

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Installer
public void RunActionOnSource(MiniYaml actionYaml, string path, ModData modData, List<string> extracted, Action<string> updateMessage)
{
// Yaml path may be specified relative to a named directory (e.g. ^SupportDir) or the detected source path
var sourcePath = actionYaml.Value.StartsWith("^") ? Platform.ResolvePath(actionYaml.Value) : FS.ResolveCaseInsensitivePath(Path.Combine(path, actionYaml.Value));
var sourcePath = actionYaml.Value.StartsWith('^') ? Platform.ResolvePath(actionYaml.Value) : FS.ResolveCaseInsensitivePath(Path.Combine(path, actionYaml.Value));
using (var source = File.OpenRead(sourcePath))
{

View File

@@ -58,7 +58,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
var player = basic.GetValue("Player", string.Empty);
if (!string.IsNullOrEmpty(player))
singlePlayer = !player.StartsWith("Multi");
singlePlayer = !player.StartsWith("Multi", StringComparison.Ordinal);
var mapSection = file.GetSection("Map");
@@ -332,9 +332,9 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
var key = $"{loc % MapSize},{loc / MapSize}";
var value = $"{type},{parts[2]}";
var node = new MiniYamlNode(key, value);
if (type.StartsWith("sc"))
if (type.StartsWith("sc", StringComparison.Ordinal))
scorches.Add(node);
else if (type.StartsWith("cr"))
else if (type.StartsWith("cr", StringComparison.Ordinal))
craters.Add(node);
}