Skip to content
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

Array.BinarySearch Audit #2284

Open
avcarr2 opened this issue Jun 12, 2023 · 2 comments
Open

Array.BinarySearch Audit #2284

avcarr2 opened this issue Jun 12, 2023 · 2 comments

Comments

@avcarr2
Copy link
Contributor

avcarr2 commented Jun 12, 2023

BinarySearch of double array does not check to see if closer value is left or right.

private int GetFirstScanWithMassOverOrEqual(double minimum)
{
int index = Array.BinarySearch(MyScanPrecursorMasses, minimum);
if (index < 0)
{
index = ~index;
}
// index of the first element that is larger than value
return index;

@avcarr2
Copy link
Contributor Author

avcarr2 commented Jun 12, 2023

All binary searches are handled incorrectly in MiniClassicSearchEngine.cs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant