From 287971eb7f64d53a592d0c81d1776e84ade6208b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 22 Sep 2014 15:03:40 -0700 Subject: Refactor QVersionNumber to use the public functions when possible Use segmentCount() and segmentAt() instead of going to m_segments. This is done in preparation for a major refactor of QVersionNumber that will store the version numbers in the object itself, without QVector. Change-Id: I03dbdee59a3c74c21a0a4e70c1bb9182250f6223 Reviewed-by: Marc Mutz --- src/corelib/tools/qversionnumber.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools/qversionnumber.h') diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 2da3103be3..449445cac6 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -83,10 +83,10 @@ public: { m_segments.reserve(3); m_segments << maj << min << mic; } inline bool isNull() const Q_DECL_NOTHROW Q_REQUIRED_RESULT - { return m_segments.isEmpty(); } + { return segmentCount() == 0; } inline bool isNormalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT - { return isNull() || m_segments.last() != 0; } + { return isNull() || segmentAt(segmentCount() - 1) != 0; } inline int majorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return segmentAt(0); } -- cgit v1.2.3