mirror of
https://github.com/LineageOS/android_device_xiaomi_whyred.git
synced 2025-10-03 17:59:24 +02:00
whyred: light: simplify notificationStates loop
Change-Id: If9e5f7b35f33fa0c5ee394b0edc542be6dd2aaea
This commit is contained in:
parent
a7654d5325
commit
d76a0057be
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue