From 901b2975dd714617f20ec13a66aeac8c5a6638fa Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Sun, 11 Oct 2020 10:25:43 +0200 Subject: QProperty: avoid needless std::function copying Change-Id: Iea6280b12e7146a9ac92f071a4c21b373e9d3ab0 Reviewed-by: Ulf Hermann --- src/corelib/kernel/qproperty_p.h | 2 +- src/corelib/kernel/qpropertyprivate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 9185c939c67..1193e3e1d2c 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -334,7 +334,7 @@ class QObjectCompatProperty : public QPropertyData char *that = const_cast(reinterpret_cast(this)); return reinterpret_cast(that - QtPrivate::detail::getOffset(Offset)); } - static bool bindingWrapper(QMetaType type, QUntypedPropertyData *dataPtr, QtPrivate::QPropertyBindingFunction binding) + static bool bindingWrapper(QMetaType type, QUntypedPropertyData *dataPtr, const QtPrivate::QPropertyBindingFunction &binding) { auto *thisData = static_cast(dataPtr); QPropertyData copy; diff --git a/src/corelib/kernel/qpropertyprivate.h b/src/corelib/kernel/qpropertyprivate.h index d03b174a419..158fdbabb4f 100644 --- a/src/corelib/kernel/qpropertyprivate.h +++ b/src/corelib/kernel/qpropertyprivate.h @@ -77,7 +77,7 @@ namespace QtPrivate { // writes binding result into dataPtr using QPropertyBindingFunction = std::function; using QPropertyObserverCallback = void (*)(QUntypedPropertyData *); -using QPropertyBindingWrapper = bool(*)(QMetaType, QUntypedPropertyData *dataPtr, QPropertyBindingFunction); +using QPropertyBindingWrapper = bool(*)(QMetaType, QUntypedPropertyData *dataPtr, const QPropertyBindingFunction &); class Q_CORE_EXPORT QPropertyBindingData { -- cgit v1.2.3