Use Layer.highest() instead of Layer.top()

We are fine with the cached value, so lets use that and save a little time,
rather than the always-correct `Layer.top()`.

Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
pull/389/head
Gergely Nagy 7 years ago
parent a8fdd4b9c4
commit f78a355760

@ -43,12 +43,12 @@ void ColormapEffect::max_layers(uint8_t max_) {
} }
void ColormapEffect::onActivate(void) { void ColormapEffect::onActivate(void) {
last_highest_layer_ = Layer.top(); last_highest_layer_ = Layer.highest();
::LEDPaletteTheme.updateHandler(map_base_, last_highest_layer_); ::LEDPaletteTheme.updateHandler(map_base_, last_highest_layer_);
} }
void ColormapEffect::update(void) { void ColormapEffect::update(void) {
if (Layer.top() == last_highest_layer_) if (Layer.highest() == last_highest_layer_)
return; return;
onActivate(); onActivate();

Loading…
Cancel
Save