1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

WindowServer: Fix a handful of clang-tidy warnings in the menu code

Some avoidable signed/unsigned mismatch, String move construction,
and functions that can be static constexpr.
This commit is contained in:
Andreas Kling 2021-05-09 11:09:58 +02:00
parent cbb06d7014
commit 4c6e3d0c59
4 changed files with 17 additions and 17 deletions

View file

@ -153,7 +153,7 @@ Window& Menu::ensure_menu_window()
return *m_menu_window;
}
int Menu::visible_item_count() const
size_t Menu::visible_item_count() const
{
if (!is_scrollable())
return m_items.size();
@ -441,7 +441,7 @@ void Menu::event(Core::Event& event)
VERIFY(new_index >= 0);
VERIFY(new_index <= static_cast<int>(m_items.size()) - 1);
if (is_scrollable() && new_index >= (m_scroll_offset + visible_item_count()))
if (is_scrollable() && new_index >= (m_scroll_offset + static_cast<int>(visible_item_count())))
++m_scroll_offset;
set_hovered_index(new_index);