Minor improvement for mergeLayers

We fill the cached `keyMap` with the value of `DefaultLayer`, so if that is the
only layer active, then we can bail out early.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/108/head
Gergely Nagy 8 years ago
parent 3dc51b233a
commit 0bdbe7385a

@ -57,6 +57,9 @@ Layer_::mergeLayers(void) {
memset (keyMap, DefaultLayer, ROWS * COLS); memset (keyMap, DefaultLayer, ROWS * COLS);
if (LayerState == (uint32_t)(1 << DefaultLayer))
return;
for (uint8_t r = 0; r < ROWS; r++) { for (uint8_t r = 0; r < ROWS; r++) {
for (uint8_t c = 0; c < COLS; c++) { for (uint8_t c = 0; c < COLS; c++) {
int8_t layer = highestLayer; int8_t layer = highestLayer;

Loading…
Cancel
Save