Quick perf improvement

Day 15 part 2 is now ~300ms on my PC with my dataset in Release (~1s in Debug, which is...striking).
This commit is contained in:
2022-12-15 14:47:00 -06:00
parent e14f71484f
commit ea72d12566

View File

@ -37,7 +37,7 @@ public struct ivec2 : IEquatable<ivec2>, IComparable<ivec2>, IComparable
public float Length => MathF.Sqrt(LengthSquared); public float Length => MathF.Sqrt(LengthSquared);
public int ManhattanDistance => Abs(this).Sum; public int ManhattanDistance => Abs(this).Sum;
public int ManhattanDistanceTo(ivec2 other) => (this - other).ManhattanDistance; public int ManhattanDistanceTo(ivec2 other) => System.Math.Abs(x - other.x) + System.Math.Abs(y - other.y);
public ivec2 GetBestDirectionTo(ivec2 p) public ivec2 GetBestDirectionTo(ivec2 p)
{ {