Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
DIV2.Format.Exporter: Minor refactorization applied to improve legibi…
Browse files Browse the repository at this point in the history
…lity in getNext lambda function on NNAlgorithm.CalculatePath() function.
  • Loading branch information
José Miguel Sánchez Fernández committed Jan 25, 2021
1 parent d871af5 commit 3c5aac6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public static List<int> CalculatePath(List<Tuple<float, float, float>> input, in
visited++;
};

Func<int, Tuple<int, float>> getNext = (start) =>
Func<int, Tuple<int, float>> getNext = (s) =>
{
var ret = new Tuple<int, float>(start, float.NaN);
var ret = new Tuple<int, float>(s, float.NaN);

for (int i = 0; i < nnVectors.Length; i++)
{
if (!nnVectors[i].isVisited)
{
float d = NNVector.Distance(nnVectors[start], nnVectors[i]);
float d = NNVector.Distance(nnVectors[s], nnVectors[i]);
if (float.IsNaN(ret.Item2) || d < ret.Item2)
ret = new Tuple<int, float>(i, d);
}
Expand Down

0 comments on commit 3c5aac6

Please sign in to comment.