compressEvent: Remove superfluous check

Before compressEvent is called, receivedPostedEvents is checked for non-zero

Change-Id: I1cbf17a6ce7f48886ff1341fb59c87ee341abf37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Mårten Nordheim 2024-08-05 17:24:28 +02:00
parent 91f48cc4b7
commit 0d3400b97d

View File

@ -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<QTimerEvent *>(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