sdm660-common: light: Drop unnecessary handled variable in setLight()
This commit is contained in:
parent
4b3dfd83e7
commit
16f37dbdcd
1 changed files with 2 additions and 6 deletions
|
@ -195,7 +195,6 @@ namespace implementation {
|
|||
|
||||
Return<Status> Light::setLight(Type type, const LightState& state) {
|
||||
LightStateHandler handler = nullptr;
|
||||
bool handled = false;
|
||||
|
||||
/* Lock global mutex until light state is updated. */
|
||||
std::lock_guard<std::mutex> lock(globalLock);
|
||||
|
@ -217,15 +216,12 @@ Return<Status> 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue