summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-12 12:22:19 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-06-22 01:09:24 +0000
commit1a030f6609ad6a9bbc1253e9e2d5efb198dc5998 (patch)
tree29f75ef32b3512e21e5ebe68b7383efb496799e0 /src/corelib/thread/qthread_p.h
parent882fc48b9e0966c8d93ce71e0843a3c50da97be8 (diff)
QPostEventList: de-inline addEvent()
While in a private header, it did manage to place QList<QPostEvent> operations near the top spots of all Qt template instantiations in a QtWidgets build. Task-number: QTBUG-97601 Pick-to: 6.4 Change-Id: I4fa1972b8764b71ad0559633131e7e44b3d4ae6a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/thread/qthread_p.h')
-rw-r--r--src/corelib/thread/qthread_p.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 7909f00e37..63c518fb57 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -73,23 +73,7 @@ public:
inline QPostEventList() : QList<QPostEvent>(), recursion(0), startOffset(0), insertionOffset(0) { }
- void addEvent(const QPostEvent &ev)
- {
- int priority = ev.priority;
- if (isEmpty() ||
- constLast().priority >= priority ||
- insertionOffset >= size()) {
- // optimization: we can simply append if the last event in
- // the queue has higher or equal priority
- append(ev);
- } else {
- // insert event in descending priority order, using upper
- // bound for a given priority (to ensure proper ordering
- // of events with the same priority)
- QPostEventList::iterator at = std::upper_bound(begin() + insertionOffset, end(), ev);
- insert(at, ev);
- }
- }
+ void addEvent(const QPostEvent &ev);
private:
//hides because they do not keep that list sorted. addEvent must be used