Remove unnecessary vector

This commit is contained in:
Henrik Rydgård
2023-12-21 11:16:10 +01:00
parent 144ed7a3ab
commit e47791d4c4
3 changed files with 7 additions and 9 deletions
+3 -2
View File
@@ -274,7 +274,8 @@ void ControlMappingScreen::CreateViews() {
root_->Add(leftColumn);
root_->Add(rightScroll_);
std::vector<KeyMap::KeyMap_IntStrPair> mappableKeys = KeyMap::GetMappableKeys();
size_t numMappableKeys = 0;
const KeyMap::KeyMap_IntStrPair *mappableKeys = KeyMap::GetMappableKeys(&numMappableKeys);
struct Cat {
const char *catName;
@@ -291,7 +292,7 @@ void ControlMappingScreen::CreateViews() {
int curCat = -1;
CollapsibleSection *curSection = nullptr;
for (size_t i = 0; i < mappableKeys.size(); i++) {
for (size_t i = 0; i < numMappableKeys; i++) {
if (curCat < (int)ARRAY_SIZE(cats) && mappableKeys[i].key == cats[curCat + 1].firstKey) {
if (curCat >= 0 && !cats[curCat].openByDefault) {
curSection->SetOpen(false);