Skip to content

Commit

Permalink
chore(web): revert ineffective attempt to optimize prop-name looping
Browse files Browse the repository at this point in the history
  • Loading branch information
jahorton committed Apr 19, 2024
1 parent 89a89c7 commit c90e6a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/web/keyboard-processor/src/keyboards/activeLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ const KeyTypesOfKeyMap = {
default: 'boolean'
} as const;

const KeySpecKeys = Object.keys(KeyTypesOfKeyMap) as (keyof typeof KeyTypesOfKeyMap)[];

// Keep in this specific order: it's the ordering of priority for default hint selection when
// based on available hints. (i.e., `layout.defaultHint == 'flick'`)
const KeyTypesOfFlickList = ['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'] as const;
Expand Down Expand Up @@ -288,7 +286,7 @@ export class ActiveKeyBase {
// is NOT available within the Android app in extremely early APIs.
// Object.entries requires Android 54.

for(const key of KeySpecKeys) {
for(const key of Object.keys(KeyTypesOfKeyMap)) {
const value = KeyTypesOfKeyMap[key as keyof typeof KeyTypesOfKeyMap];
switch(value) {
case 'subkeys':
Expand All @@ -310,7 +308,9 @@ export class ActiveKeyBase {
break;
case 'flicks':
const flickObj = rawKey[key];
if(typeof flickObj != 'object') {
if(flickObj === undefined) {
break;
} else if(typeof flickObj != 'object') {
delete rawKey[key];
} else {
for(const flickKey of KeyTypesOfFlickList) {
Expand Down

0 comments on commit c90e6a3

Please sign in to comment.