1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:17:42 +00:00

AK: Fix overflow and mixed-signedness issues in binary_search() (#2961)

This commit is contained in:
Muhammad Zahalqa 2020-08-02 22:10:35 +03:00 committed by GitHub
parent 2242f69cd6
commit 615ba0f368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 8 deletions

View file

@ -184,7 +184,7 @@ bool XtermSuggestionDisplay::cleanup()
size_t XtermSuggestionDisplay::fit_to_page_boundary(size_t selection_index)
{
ASSERT(m_pages.size() > 0);
int index = 0;
size_t index = 0;
auto* match = binary_search(
m_pages.span(), { selection_index, selection_index }, [](auto& a, auto& b) -> int {