From a2e190f5a2e2a620eecf41d824d9c6a86c51cc9d Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Mon, 3 Jun 2019 14:11:20 +0200 Subject: [PATCH] sdm660-common: light: Drop unnecessary handled variable in setLight() Change-Id: If6e76671cc1860102a5da6502338cda138dad3ee --- light/Light.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/light/Light.cpp b/light/Light.cpp index c243a130..7effab80 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -224,7 +224,6 @@ namespace implementation { Return Light::setLight(Type type, const LightState& state) { LightStateHandler handler = nullptr; - bool handled = false; /* Lock global mutex until light state is updated. */ std::lock_guard lock(globalLock); @@ -246,15 +245,12 @@ Return Light::setLight(Type type, const LightState& state) { for (LightBackend& backend : backends) { if (handler == backend.handler && isLit(backend.state)) { handler(backend.state); - handled = true; - break; + return Status::SUCCESS; } } /* If no type has been lit up, then turn off the hardware. */ - if (!handled) { - handler(state); - } + handler(state); return Status::SUCCESS; }