Avoid compiler warning

Under some configure options, gcc13 emits an intractable warning on
this line. This patch works around it.

Fixes: QTBUG-115809
Pick-to: 6.6 6.5 6.2
Change-Id: Ib63f2ad81ebdb1f609a7f42c25119c5ae29f08bb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Eirik Aavitsland 2023-08-14 09:36:50 +02:00
parent f56fc425f9
commit f8f23c43fe

View File

@ -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));