From 1a09c599b38b5922e9823d0ce37af6d245a690ed Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 23 Aug 2016 14:41:32 -0700 Subject: [PATCH] QDeadlineTimer: inline the isForever function The constructor that sets it is inline already, so there's no point in hiding this. Change-Id: I66707fdfe8eb460a9c72fffd146d8dbc35b13056 Reviewed-by: Marc Mutz --- src/corelib/kernel/qdeadlinetimer.cpp | 6 ++---- src/corelib/kernel/qdeadlinetimer.h | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp index 7906b29ece..957d985c31 100644 --- a/src/corelib/kernel/qdeadlinetimer.cpp +++ b/src/corelib/kernel/qdeadlinetimer.cpp @@ -408,16 +408,14 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time */ /*! + \fn bool QDeadlineTimer::isForever() const + Returns true if this QDeadlineTimer object never expires, false otherwise. For timers that never expire, remainingTime() always returns -1 and deadline() returns the maximum value. \sa ForeverConstant, hasExpired(), remainingTime() */ -bool QDeadlineTimer::isForever() const Q_DECL_NOTHROW -{ - return t1 == (std::numeric_limits::max)(); -} /*! Returns true if this QDeadlineTimer object has expired, false if there diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h index ac8a09ba97..3b97b89359 100644 --- a/src/corelib/kernel/qdeadlinetimer.h +++ b/src/corelib/kernel/qdeadlinetimer.h @@ -65,7 +65,8 @@ public: void swap(QDeadlineTimer &other) { qSwap(t1, other.t1); qSwap(t2, other.t2); qSwap(type, other.type); } - bool isForever() const Q_DECL_NOTHROW; + Q_DECL_CONSTEXPR bool isForever() const Q_DECL_NOTHROW + { return t1 == (std::numeric_limits::max)(); } bool hasExpired() const Q_DECL_NOTHROW; Qt::TimerType timerType() const Q_DECL_NOTHROW