Skip to content

Commit 089bb32

Browse files
committed
refactor: single find() replaces contains()+at() in action name lookup
1 parent 1dd06c8 commit 089bb32

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Plugin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ void OnInputLoaded()
159159
{ LongPressAction::kQuests, "Quests" },
160160
{ LongPressAction::kJournal, "Journal" },
161161
};
162-
const auto actionName = kActionNames.contains(btn.action) ? kActionNames.at(btn.action) : "Unknown";
162+
const auto it = kActionNames.find(btn.action);
163+
const auto actionName = it != kActionNames.end() ? it->second : "Unknown";
163164
logger::info("{} → {}", btn.name, actionName);
164165
}
165166

0 commit comments

Comments
 (0)