From 705028f60c75dc5f2268f8de3b15246c193a0449 Mon Sep 17 00:00:00 2001 From: gaozhichao Date: Tue, 30 Apr 2024 16:13:18 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E9=9D=99=E6=80=81=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gaozhichao --- services/timer/src/timer_manager.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/services/timer/src/timer_manager.cpp b/services/timer/src/timer_manager.cpp index 35aa98f..3f18e22 100644 --- a/services/timer/src/timer_manager.cpp +++ b/services/timer/src/timer_manager.cpp @@ -771,11 +771,8 @@ void TimerManager::NotifyWantAgentBasedOnUser(const std::shared_ptr & void TimerManager::DeliverTimersLocked(const std::vector> &triggerList) { auto wakeupNums = 0; - for (const auto &timer : triggerList) { - if (timer->wakeup) { - wakeupNums += 1; - } - } + wakeupNum = std::count_if(triggerList.begin(); triggerList.end(); + [](auto timer){return timer->wakeup}); for (const auto &timer : triggerList) { if (timer->wakeup) { StatisticReporter(IPCSkeleton::GetCallingPid(), wakeupNums, timer); -- Gitee