From be1ce6b26909256e62c2b39e4de9f8f79d070937 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 8 Jul 2020 10:57:21 +0200 Subject: Separate the error case when evaluating bindings There's no point in returning a usually empty error when evaluating bindings, adding overhead to the regular code path. Instead, the error can be set on the currently evaluating binding if required. This streamlines the functor used to wrap the binding and should thus expand to less code and execute faster in the regular case. To achieve this, expose a pointer to the currently evaluating binding in the private API (as QtQml needs it to be able to report errors). The error case now requires one additional TLS lookup, but we don't really care about performance in that case anyway. Change-Id: Iecb450e765244930a41d813fcf8eb4013957a6a3 Reviewed-by: Fabian Kosmale --- src/corelib/kernel/qpropertybinding_p.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/kernel/qpropertybinding_p.h') diff --git a/src/corelib/kernel/qpropertybinding_p.h b/src/corelib/kernel/qpropertybinding_p.h index 6257e4506e..7722a4b7c5 100644 --- a/src/corelib/kernel/qpropertybinding_p.h +++ b/src/corelib/kernel/qpropertybinding_p.h @@ -179,6 +179,11 @@ public: static QPropertyBindingPrivate *get(const QUntypedPropertyBinding &binding) { return binding.d.data(); } + + void setError(QPropertyBindingError &&e) + { error = std::move(e); } + + static QPropertyBindingPrivate *currentlyEvaluatingBinding(); }; QT_END_NAMESPACE -- cgit v1.2.3