From dc6578a37370f042963d848b4b448d7bbe284052 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 16 Mar 2023 15:16:11 +0200 Subject: [PATCH] QTimerInfo: fix lambda name We are trying to find the first time in the list that has not expired. Drive-by change: fix a narrowing conversion warning Change-Id: I9e5f95b0f9d767f1fda9061c928e3182f4be6a85 Reviewed-by: Edward Welbourne --- src/corelib/kernel/qtimerinfo_unix.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index 390fd96644..744f9f1fce 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -530,9 +530,10 @@ int QTimerInfoList::activateTimers() repairTimersIfNeeded(); // Find out how many timer have expired - auto isExpired = [&now](const QTimerInfo *t) { return now < t->timeout; }; - auto it = std::find_if(cbegin(), cend(), isExpired); - int maxCount = it - cbegin(); + auto stillActive = [&now](const QTimerInfo *t) { return now < t->timeout; }; + // Find first one still active (list is sorted by timeout) + auto it = std::find_if(cbegin(), cend(), stillActive); + auto maxCount = it - cbegin(); int n_act = 0; //fire the timers.