Fix SwitchKeymapByAbbreviation() and use it in place of a for block of equivalent functionality within UsbCommand_ApplyConfig()
This commit is contained in:
@@ -45,14 +45,8 @@ void UsbCommand_ApplyConfig(void)
|
||||
}
|
||||
|
||||
// Switch to the keymap of the updated configuration of the same name or the default keymap.
|
||||
|
||||
for (uint8_t keymapId = 0; keymapId < AllKeymapsCount; keymapId++) {
|
||||
if (AllKeymaps[keymapId].abbreviationLen == oldKeymapAbbreviationLen &&
|
||||
!memcmp(oldKeymapAbbreviation, AllKeymaps[keymapId].abbreviation, oldKeymapAbbreviationLen))
|
||||
{
|
||||
SwitchKeymapById(keymapId);
|
||||
return;
|
||||
}
|
||||
if (SwitchKeymapByAbbreviation(oldKeymapAbbreviationLen, oldKeymapAbbreviation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SwitchKeymapById(DefaultKeymapIndex);
|
||||
|
||||
Reference in New Issue
Block a user