Fix CA1310, CA1311
This commit is contained in:
committed by
Matthias Mailänder
parent
d83e579dfe
commit
285443f10f
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user