whyred: light: simplify notificationStates loop

Change-Id: If9e5f7b35f33fa0c5ee394b0edc542be6dd2aaea
This commit is contained in:
Demon Singur 2018-04-18 05:50:06 +00:00 committed by Vasishath Kaushal
parent a7654d5325
commit d76a0057be

View file

@ -179,13 +179,13 @@ static std::vector<std::pair<Type, LightState>> notificationStates = {
};
static void handleNotification(Type type, const LightState& state) {
for(auto it = notificationStates.begin(); it != notificationStates.end(); it++) {
if (it->first == type) {
it->second = state;
for(auto it : notificationStates) {
if (it.first == type) {
it.second = state;
}
if (isLit(it->second)) {
setNotification(it->second);
if (isLit(it.second)) {
setNotification(it.second);
return;
}
}