Commit d492dc57 authored by Jan Kundrát's avatar Jan Kundrát Committed by David Edmundson

Prefer an algorithm over an explicit for loop

Differential Revision: https://phabricator.kde.org/D2660
parent 11cd37ab
......@@ -828,11 +828,10 @@ int Core::currentChargePercent() const
void Core::onResumingFromIdle()
{
// Wake up the actions in which an idle action was triggered
auto i = m_pendingResumeFromIdleActions.begin();
while (i != m_pendingResumeFromIdleActions.end()) {
(*i)->onWakeupFromIdle();
i = m_pendingResumeFromIdleActions.erase(i);
}
std::for_each(m_pendingResumeFromIdleActions.cbegin(), m_pendingResumeFromIdleActions.cend(),
std::mem_fn(&PowerDevil::Action::onWakeupFromIdle));
m_pendingResumeFromIdleActions.clear();
}
void Core::onNotificationTimeout()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment