From 0d3400b97d3659f6af8adac218b4cff80cdd42b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 5 Aug 2024 17:24:28 +0200 Subject: [PATCH] compressEvent: Remove superfluous check Before compressEvent is called, receivedPostedEvents is checked for non-zero Change-Id: I1cbf17a6ce7f48886ff1341fb59c87ee341abf37 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 85d14e79e38..fe1827ef578 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1724,9 +1724,8 @@ bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEven Q_ASSERT(receiver); Q_ASSERT(postedEvents); - int receiverPostedEvents = receiver->d_func()->postedEvents.loadRelaxed(); // compress posted timers to this object. - if (event->type() == QEvent::Timer && receiverPostedEvents > 0) { + if (event->type() == QEvent::Timer) { const int timerId = static_cast(event)->timerId(); auto it = postedEvents->cbegin(); const auto end = postedEvents->cend(); @@ -1742,7 +1741,7 @@ bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEven return false; } - if (event->type() == QEvent::Quit && receiverPostedEvents > 0) { + if (event->type() == QEvent::Quit) { for (const QPostEvent &cur : std::as_const(*postedEvents)) { if (cur.receiver != receiver || cur.event == nullptr