Skip to content

Commit

Permalink
Get rid of trailing whitespace
Browse files Browse the repository at this point in the history
Thanks VisualStudio
  • Loading branch information
blowfishpro committed Jan 10, 2019
1 parent ee9073b commit e0c1400
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ModuleManager/MMPatchLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ private bool IsCacheUpToDate()
// Hash the file path so the checksum change if files are moved
byte[] pathBytes = Encoding.UTF8.GetBytes(files[i].url);
sha.TransformBlock(pathBytes, 0, pathBytes.Length, pathBytes, 0);

// hash the file content
byte[] contentBytes = File.ReadAllBytes(files[i].fullPath);
sha.TransformBlock(contentBytes, 0, contentBytes.Length, contentBytes, 0);

filesha.ComputeHash(contentBytes);
if (!filesSha.ContainsKey(files[i].url))
{
Expand Down Expand Up @@ -372,7 +372,7 @@ private bool CheckFilesChange(UrlDir.UrlFile[] files, ConfigNode shaConfigNode)
StringBuilder changes = new StringBuilder();

changes.Append("Changes :\n");

for (int i = 0; i < files.Length; i++)
{
ConfigNode fileNode = GetFileNode(shaConfigNode, files[i].url);
Expand Down Expand Up @@ -418,7 +418,7 @@ private ConfigNode GetFileNode(ConfigNode shaConfigNode, string filename)
}
return null;
}


private void CreateCache(IEnumerable<IProtoUrlConfig> databaseConfigs, int patchedNodeCount)
{
Expand Down Expand Up @@ -512,7 +512,7 @@ private void SaveModdedTechTree()
private IEnumerable<IProtoUrlConfig> LoadCache()
{
ConfigNode cache = ConfigNode.Load(cachePath);

if (cache.HasValue("patchedNodeCount") && int.TryParse(cache.GetValue("patchedNodeCount"), out int patchedNodeCount))
status = "ModuleManager: " + patchedNodeCount + " patch" + (patchedNodeCount != 1 ? "es" : "") + " loaded from cache";

Expand Down Expand Up @@ -586,7 +586,7 @@ public static ConfigNode ModifyNode(NodeStack original, ConfigNode mod, PatchCon
#endif

Command cmd = CommandParser.Parse(modVal.name, out string valName);

Operator op;
if (valName.Length > 2 && valName[valName.Length - 2] == ',')
op = Operator.Assign;
Expand All @@ -602,10 +602,10 @@ public static ConfigNode ModifyNode(NodeStack original, ConfigNode mod, PatchCon
context.progress.Error(context.patchUrl, "Error - Cannot find value assigning command: " + valName);
continue;
}

if (op != Operator.Assign)
{
if (double.TryParse(modVal.value, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out double s)
if (double.TryParse(modVal.value, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out double s)
&& double.TryParse(val.value, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out double os))
{
switch (op)
Expand Down Expand Up @@ -1000,7 +1000,7 @@ public static ConfigNode ModifyNode(NodeStack original, ConfigNode mod, PatchCon
if (n != null)
subNodes.Add(n);
}

if (command == Command.Replace)
{
// if the original exists modify it
Expand Down Expand Up @@ -1362,7 +1362,7 @@ private static ConfigNode.Value RecurseVariableSearch(string path, NodeStack nod
context.logger.Warning("Cannot find key " + valName + " in " + nodeStack.value.name);
return null;
}

if (match.Groups[3].Success)
{
ConfigNode.Value newVal = new ConfigNode.Value(cVal.name, cVal.value);
Expand Down Expand Up @@ -1471,7 +1471,7 @@ private static string ProcessVariableSearch(string value, NodeStack nodeStack, P
return null;
}
}
else if (double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out double s)
else if (double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out double s)
&& double.TryParse(oValue, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out double os))
{
switch (op)
Expand Down Expand Up @@ -1543,7 +1543,7 @@ public static List<string> SplitConstraints(string condition)
public static bool CheckConstraints(ConfigNode node, string constraints)
{
constraints = constraints.RemoveWS();

if (constraints.Length == 0)
return true;

Expand Down

0 comments on commit e0c1400

Please sign in to comment.