From f14e31fdd6daaba4d286b8b6312962399c9b5b4d Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 1 Aug 2017 16:10:17 +0200 Subject: [PATCH] Limit the layer checking to `max_layers_` Instead of iterating down from the 32th layer, do so from `max_layers_` instead. Not only is this more performant, it allows us to have higher layers outside of Colormap's control. Signed-off-by: Gergely Nagy --- src/Kaleidoscope/Colormap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kaleidoscope/Colormap.cpp b/src/Kaleidoscope/Colormap.cpp index bd564a73..623ab845 100644 --- a/src/Kaleidoscope/Colormap.cpp +++ b/src/Kaleidoscope/Colormap.cpp @@ -47,7 +47,7 @@ void ColormapEffect::max_layers(uint8_t max_) { } void ColormapEffect::update(void) { - for (uint8_t l = 0; l < 32; l++) { + for (uint8_t l = 0; l < max_layers_; l++) { if (!Layer.isOn(l)) continue;