QXmlString: add noexcept to size() and operator QStringView()
size() is obviously noexcept. QStringView ctors have an implied precondition that the (ptr, n) range passed represent a valid range. Since this is a member function QXmlString, we can assume that the class variants hold and m_string itself represents valid (or null) data, so this operation is also noexcept. As a drive-by, remove pointless inline keywords. Change-Id: Ia7637e77005062b6515ceac4b62efaf14a2eb486 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 792bea9be3760f58de4d1c30fbecab0071fe311e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
ee6b101adf
commit
79dec148a9
@ -31,8 +31,8 @@ public:
|
|||||||
m_string.swap(other.m_string);
|
m_string.swap(other.m_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline operator QStringView() const { return QStringView(m_string.data(), m_string.size); }
|
operator QStringView() const noexcept { return QStringView(m_string.data(), m_string.size); }
|
||||||
inline qsizetype size() const { return m_string.size; }
|
qsizetype size() const noexcept { return m_string.size; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user