Fix minor bug in layer deactivation

There was a call to `memmove()` call that shifted one extra byte of memory
whenever a layer was deactivated.  I don't think that `memmove()` would actually
overwrite the source byte, so it shouldn't have any visible effect, but this is
more correct.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1039/head
Michael Richters 4 years ago
parent 8f3fab579b
commit 3a181c2020
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -219,7 +219,7 @@ void Layer_::deactivate(uint8_t layer) {
// above it down to fill in the gap // above it down to fill in the gap
for (uint8_t i = 0; i < active_layer_count_; ++i) { for (uint8_t i = 0; i < active_layer_count_; ++i) {
if (active_layers_[i] == layer) { if (active_layers_[i] == layer) {
memmove(&active_layers_[i], &active_layers_[i + 1], active_layer_count_ - i); memmove(&active_layers_[i], &active_layers_[i + 1], active_layer_count_ - (i + 1));
--active_layer_count_; --active_layer_count_;
break; break;
} }

Loading…
Cancel
Save