Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
find the nearest line, previously was always returning last #83
I have been using part of the code from samples (found it in msos project) to display the disassembly code for BenchmarkDotNet and I have realized, that always the last line of source code was printed.
The bug fix was trivial: when you find smaller distance, set the current distance to it. So far the value of distance was always int.Max, so the value of if (dist < distance) was always true, so the loop was going to the end, and returning the last line.