diff options
| author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-05-21 12:04:16 +0200 |
|---|---|---|
| committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-06-08 22:41:58 +0200 |
| commit | d598066dcfdb8a8330f9df029172188d2296fed7 (patch) | |
| tree | 2e645b3de5b35ed37decfc15f4ff8d1a3e64786a /src/corelib/thread/qfutureinterface.cpp | |
| parent | 49c5724cb8eeebf8176b2122401716f8d11bcc11 (diff) | |
QFutureInterface(Base): code tidies
refT()/derefT() can be marked noexcept; we don't care about not
overflowing the refcounter as a precondition. (This is BC, as no
compiler mangles noexcept.) This in turn allows to mark a constructor
calling refT() as noexcept.
Driveby: mark also the same functions to not be `const` in Qt 7.
They clearly are meant to modify *this, and constness only works
because of the unmanaged (raw) d-pointer.
Change-Id: I8d7d365640ff2e1cedc0a234c9abccdfc95ba6e3
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread/qfutureinterface.cpp')
| -rw-r--r-- | src/corelib/thread/qfutureinterface.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index 89062451911..9bb7d505e25 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -586,12 +586,12 @@ void QFutureInterfaceBase::swap(QFutureInterfaceBase &other) noexcept qSwap(d, other.d); } -bool QFutureInterfaceBase::refT() const +bool QFutureInterfaceBase::refT() const noexcept { return d->refCount.refT(); } -bool QFutureInterfaceBase::derefT() const +bool QFutureInterfaceBase::derefT() const noexcept { // Called from ~QFutureInterface return !d || d->refCount.derefT(); |
