From 77d528f8d328d43fa367bd4887ad21b5e6b6311e Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Mon, 28 Jun 2021 11:20:23 +0200 Subject: [PATCH] QProperty: Force inlining of addObserver The method is only called in two places: observerProperty (which only takes care of calling unlink, too, if necessary) and in registerWithCurrentlyEvaluatingBinding_helper. In the first case, the method most likely gets inlined anyway. In the latter case, we really want to avoid the overhead of an additional function call to speed up registration of the property with the binding. Considering that it is an internal method, there is no need to worry about code explosion. Pick-to: 6.2 Change-Id: I3f0f0e37108f3859321d3b432e37fc8da3c15dc0 Reviewed-by: Lars Knoll --- src/corelib/kernel/qproperty_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 33bcc72ad7..96e89926db 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -83,7 +83,7 @@ struct Q_AUTOTEST_EXPORT QPropertyBindingDataPointer d = reinterpret_cast(observer); } static void fixupAfterMove(QtPrivate::QPropertyBindingData *ptr); - void addObserver(QPropertyObserver *observer); + void Q_ALWAYS_INLINE addObserver(QPropertyObserver *observer); void setFirstObserver(QPropertyObserver *observer); QPropertyObserverPointer firstObserver() const;