From 38433e56f7484126de85a69b161b78dc2e6c89c7 Mon Sep 17 00:00:00 2001 From: netpok Date: Mon, 25 Feb 2019 22:24:53 +0100 Subject: [PATCH] Replace compare cycle with memcmp --- sonoff/xdrv_04_light.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sonoff/xdrv_04_light.ino b/sonoff/xdrv_04_light.ino index 702bd8ad7..9b65cea2b 100644 --- a/sonoff/xdrv_04_light.ino +++ b/sonoff/xdrv_04_light.ino @@ -984,10 +984,8 @@ void LightAnimate(void) } if ((Settings.light_scheme < LS_MAX) || !light_power) { - for (uint8_t i = 0; i < light_subtype; i++) { - if (light_last_color[i] != light_new_color[i]) { + if (memcmp(light_last_color, light_new_color, light_subtype)) { light_update = 1; - } } if (light_update) { light_update = 0;