Remove some misc redundancies
This commit is contained in:
@@ -314,7 +314,7 @@ namespace OpenRA.FileFormats
|
||||
return null;
|
||||
}
|
||||
|
||||
static object ParseYesNo(string p, System.Type fieldType, string field)
|
||||
static object ParseYesNo(string p, Type fieldType, string field)
|
||||
{
|
||||
p = p.ToLowerInvariant();
|
||||
if (p == "yes") return true;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public static MiniYamlNode SaveField(object o, string field)
|
||||
{
|
||||
return new MiniYamlNode(field, FieldSaver.FormatValue(o, o.GetType().GetField(field)));
|
||||
return new MiniYamlNode(field, FormatValue(o, o.GetType().GetField(field)));
|
||||
}
|
||||
|
||||
public static string FormatValue(object v, Type t)
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRA.FileFormats
|
||||
/// A fast (native) CRC32 implementation that can be used on a regular byte arrays.
|
||||
/// </summary>
|
||||
/// <param name="data">The data from which to calculate the checksum.</param>
|
||||
/// <param name="polynomal">The polynomal.</param>
|
||||
/// <param name="polynomial">The polynomal.</param>
|
||||
/// <returns>
|
||||
/// The calculated checksum.
|
||||
/// </returns>
|
||||
@@ -115,7 +115,7 @@ namespace OpenRA.FileFormats
|
||||
/// </summary>
|
||||
/// <param name="data"> [in,out] If non-null, the.</param>
|
||||
/// <param name="len"> The length of the data data.</param>
|
||||
/// <param name="polynomal">The polynomal to xor with.</param>
|
||||
/// <param name="polynomial">The polynomal to xor with.</param>
|
||||
/// <returns>The calculated checksum.</returns>
|
||||
public static unsafe uint Calculate(byte* data, uint len, uint polynomial)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.FileFormats
|
||||
IniSection ProcessSection(string line)
|
||||
{
|
||||
Match m = sectionPattern.Match(line);
|
||||
if (m == null || !m.Success)
|
||||
if (!m.Success)
|
||||
return null;
|
||||
string sectionName = m.Groups[1].Value.ToLowerInvariant();
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.FileFormats
|
||||
name = Platform.SupportDir + name.Substring(1);
|
||||
|
||||
FolderPaths.Add(name);
|
||||
Action a = () => FileSystem.MountInner(OpenPackage(name, annotation, order++));
|
||||
Action a = () => MountInner(OpenPackage(name, annotation, order++));
|
||||
|
||||
if (optional)
|
||||
try { a(); }
|
||||
@@ -197,8 +197,8 @@ namespace OpenRA.FileFormats
|
||||
if (assemblyCache.TryGetValue(filename, out a))
|
||||
return a;
|
||||
|
||||
if (FileSystem.Exists(filename))
|
||||
using (var s = FileSystem.Open(filename))
|
||||
if (Exists(filename))
|
||||
using (var s = Open(filename))
|
||||
{
|
||||
var buf = new byte[s.Length];
|
||||
s.Read(buf, 0, buf.Length);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenRA.FileFormats.Primitives
|
||||
|
||||
public IEnumerable ObservedItems
|
||||
{
|
||||
get { return base.Items; }
|
||||
get { return Items; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user