1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:18:11 +00:00

Everywhere: "indexes" => "indices"

I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
This commit is contained in:
Andreas Kling 2021-04-29 22:23:52 +02:00
parent 7ae7170d61
commit 3d4afe7614
29 changed files with 139 additions and 139 deletions

View file

@ -618,15 +618,15 @@ void Menu::set_visible(bool visible)
void Menu::add_item(NonnullOwnPtr<MenuItem> item)
{
if (auto alt_shortcut = find_ampersand_shortcut_character(item->text())) {
m_alt_shortcut_character_to_item_indexes.ensure(tolower(alt_shortcut)).append(m_items.size());
m_alt_shortcut_character_to_item_indices.ensure(tolower(alt_shortcut)).append(m_items.size());
}
m_items.append(move(item));
}
const Vector<size_t>* Menu::items_with_alt_shortcut(u32 alt_shortcut) const
{
auto it = m_alt_shortcut_character_to_item_indexes.find(tolower(alt_shortcut));
if (it == m_alt_shortcut_character_to_item_indexes.end())
auto it = m_alt_shortcut_character_to_item_indices.find(tolower(alt_shortcut));
if (it == m_alt_shortcut_character_to_item_indices.end())
return nullptr;
return &it->value;
}