diff --git a/packages/uhk-common/src/config-serializer/config-items/module.ts b/packages/uhk-common/src/config-serializer/config-items/module.ts index 45a350be..7681e5de 100644 --- a/packages/uhk-common/src/config-serializer/config-items/module.ts +++ b/packages/uhk-common/src/config-serializer/config-items/module.ts @@ -54,15 +54,12 @@ export class Module { const noneAction = new NoneAction(); - const keyActions: KeyAction[] = this.keyActions.map(keyAction => { + buffer.writeArray(this.keyActions, (uhkBuffer: UhkBuffer, keyAction: KeyAction) => { if (keyAction) { - return keyAction; + keyAction.toBinary(uhkBuffer, userConfiguration); + } else { + noneAction.toBinary(uhkBuffer); } - return noneAction; - }); - - buffer.writeArray(keyActions, (uhkBuffer: UhkBuffer, keyAction: KeyAction) => { - keyAction.toBinary(uhkBuffer, userConfiguration); }); }