From d76a0057bec726921ea3125919d3779b67e7de75 Mon Sep 17 00:00:00 2001 From: Demon Singur Date: Wed, 18 Apr 2018 05:50:06 +0000 Subject: [PATCH] whyred: light: simplify notificationStates loop Change-Id: If9e5f7b35f33fa0c5ee394b0edc542be6dd2aaea --- light/Light.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/light/Light.cpp b/light/Light.cpp index bae9c9b..7a19a58 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -179,13 +179,13 @@ static std::vector> 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; } }