Skip to content

Fix BinarySearch not-found return value#93

Open
nargeslein wants to merge 1 commit intoTheAlgorithms:mainfrom
nargeslein:fix-binary-search-not-found
Open

Fix BinarySearch not-found return value#93
nargeslein wants to merge 1 commit intoTheAlgorithms:mainfrom
nargeslein:fix-binary-search-not-found

Conversation

@nargeslein
Copy link
Copy Markdown

Summary

  • Change BinarySearch result type to int256 so -1 can represent not found
  • Fix binary search bounds to avoid underflow or looping issues
  • Add test coverage for not-found result

Tests

  • forge test --match-path src/Searches/test/BinarySearch.t.sol

@nargeslein nargeslein requested a review from mkubdev as a code owner May 4, 2026 11:59
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

Successfully merging this pull request may close these issues.

1 participant