From f06ad33e46ba109eeace997d9dac3f1a7be8a51e Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 14 Aug 2023 09:36:50 +0200 Subject: [PATCH] Avoid compiler warning Under some configure options, gcc13 emits an intractable warning on this line. This patch works around it. Fixes: QTBUG-115809 Change-Id: Ib63f2ad81ebdb1f609a7f42c25119c5ae29f08bb Reviewed-by: Paul Olav Tvete (cherry picked from commit f8f23c43feb2fb233a8f047cd1b82259498d9aeb) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qpathclipper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 7ada65ce033..10a0639b536 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -650,7 +650,8 @@ int QKdPointTree::build(int begin, int end, int depth) } } - qSwap(m_nodes.at(last), m_nodes.at(begin)); + if (last != begin) + qSwap(m_nodes.at(last), m_nodes.at(begin)); if (last > begin) m_nodes.at(last).left = &m_nodes.at(build(begin, last, depth + 1));