New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find the nearest line, previously was always returning last #83

Merged
merged 1 commit into from Aug 9, 2017

Conversation

Projects
None yet
3 participants
@adamsitnik
Member

adamsitnik commented Jul 30, 2017

Hi!

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.

@msftclas

This comment has been minimized.

Show comment
Hide comment
@msftclas

msftclas Jul 30, 2017

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

msftclas commented Jul 30, 2017

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@leculver leculver merged commit ed250d8 into Microsoft:master Aug 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment