Skip to content

Commit

Permalink
Inline infrequently used extension methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 4, 2014
1 parent d914607 commit 5fe2ab6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Plugin/KethaneData.cs
Expand Up @@ -69,7 +69,7 @@ public override void OnSave(ConfigNode configNode)
{
var timer = System.Diagnostics.Stopwatch.StartNew();

configNode.AddValue("Version", System.Reflection.Assembly.GetExecutingAssembly().GetInformationalVersion());
configNode.AddValue("Version", System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).ProductVersion);

foreach (var resource in resources)
{
Expand Down
4 changes: 2 additions & 2 deletions Plugin/MapOverlay.cs
Expand Up @@ -548,12 +548,12 @@ private void setUpMesh()
{
for (var i = 0; i < 5; i++)
{
triangles.Add(t + 1 + i, t + 1 + (i + 1) % 5, t);
triangles.AddRange(new[] { t + 1 + i, t + 1 + (i + 1) % 5, t });
}
}
else
{
triangles.Add(t + 0, t + 1, t + 2, t + 2, t + 3, t + 4, t + 4, t + 5, t + 0, t + 0, t + 2, t + 4);
triangles.AddRange(new[] { t + 0, t + 1, t + 2, t + 2, t + 3, t + 4, t + 4, t + 5, t + 0, t + 0, t + 2, t + 4 });
}
}

Expand Down
12 changes: 0 additions & 12 deletions Plugin/Misc.cs
Expand Up @@ -8,13 +8,6 @@ namespace Kethane
{
internal static class Misc
{
public static float Dot(this Vector3 lhs, Vector3 rhs) { return Vector3.Dot(lhs, rhs); }

public static void Add<T>(this List<T> list, params T[] values)
{
list.AddRange(values);
}

#region Parsing utility methods

public static float Parse(string s, float defaultValue)
Expand Down Expand Up @@ -89,11 +82,6 @@ public static ParticleRenderMode Parse(string s, ParticleRenderMode defaultValue

#endregion

public static string GetInformationalVersion(this System.Reflection.Assembly assembly)
{
return System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion;
}

#region Encoding

public static byte[] FromBase64String(string encoded)
Expand Down
2 changes: 1 addition & 1 deletion Plugin/PartModules/HeatSinkAnimator.cs
Expand Up @@ -92,7 +92,7 @@ public override void OnFixedUpdate()

var surfaceVelocity = this.vessel.GetSrfVelocity();
var radiatorNormal = this.part.transform.InverseTransformDirection(RadiatorNormal);
var airSpeed = (surfaceVelocity - surfaceVelocity.Dot(radiatorNormal) * radiatorNormal).magnitude;
var airSpeed = (surfaceVelocity - Vector3.Dot(surfaceVelocity, radiatorNormal) * radiatorNormal).magnitude;

var deployAmount = Mathf.Clamp01(openAnimationStates.First().normalizedTime);
var rate = InternalDissipation + deployAmount * (HeatSinkDissipation + pressure * (PressureDissipation + AirSpeedDissipation * airSpeed));
Expand Down

0 comments on commit 5fe2ab6

Please sign in to comment.