From 64a5370817f509546b473f3e8c141abf0b76184f Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 22 Jan 2024 13:34:48 +0100 Subject: [PATCH] QJniArray: fix prototype of member functions Remove the redundant template parameter. As a drive-by, swap pointer members using qt_ptr_swap instead of std::swap. Found during header review. Task-number: QTBUG-119952 Change-Id: Ibed9c7e7866672401b9dd87ff6e33db8f61e7282 Reviewed-by: Marc Mutz (cherry picked from commit 3fd49e95a9db3f4c6805c7fcf85fbebe1d6463d0) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qjniarray.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qjniarray.h b/src/corelib/kernel/qjniarray.h index 0fec3d094ec..a448b68d4bc 100644 --- a/src/corelib/kernel/qjniarray.h +++ b/src/corelib/kernel/qjniarray.h @@ -24,11 +24,11 @@ struct QJniArrayIterator constexpr QJniArrayIterator &operator=(const QJniArrayIterator &other) noexcept = default; constexpr QJniArrayIterator &operator=(QJniArrayIterator &&other) noexcept = default; - friend bool operator==(const QJniArrayIterator &lhs, const QJniArrayIterator &rhs) noexcept + friend bool operator==(const QJniArrayIterator &lhs, const QJniArrayIterator &rhs) noexcept { return lhs.m_array == rhs.m_array && lhs.m_index == rhs.m_index; } - friend bool operator!=(const QJniArrayIterator &lhs, const QJniArrayIterator &rhs) noexcept + friend bool operator!=(const QJniArrayIterator &lhs, const QJniArrayIterator &rhs) noexcept { return !(lhs == rhs); } @@ -36,16 +36,16 @@ struct QJniArrayIterator { return m_array->at(m_index); } - friend QJniArrayIterator &operator++(QJniArrayIterator &that) noexcept + friend QJniArrayIterator &operator++(QJniArrayIterator &that) noexcept { ++that.m_index; return that; } - void swap(QJniArrayIterator &other) noexcept + void swap(QJniArrayIterator &other) noexcept { std::swap(m_index, other.m_index); - std::swap(m_array, other.m_array); + qt_ptr_swap(m_array, other.m_array); } private: