Remove some misc redundancies

This commit is contained in:
ScottNZ
2013-11-12 17:40:34 +13:00
parent 8197f29606
commit 1394c1dcee
48 changed files with 104 additions and 103 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -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)
{

View File

@@ -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();

View File

@@ -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);

View File

@@ -53,7 +53,7 @@ namespace OpenRA.FileFormats.Primitives
public IEnumerable ObservedItems
{
get { return base.Items; }
get { return Items; }
}
}
}