From 6666303f2782d4151c74bd9a056857fcc487b199 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 31 Jul 2023 02:25:45 +0000 Subject: [PATCH] shush compiler warning the QString length is checked by the above QString::isEmpty() call but the compiler knows not what it does Signed-off-by: Ivailo Monev --- src/core/io/qdir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/io/qdir.cpp b/src/core/io/qdir.cpp index f02b77f8c..d7a500af3 100644 --- a/src/core/io/qdir.cpp +++ b/src/core/io/qdir.cpp @@ -1608,7 +1608,7 @@ QString QDir::cleanPath(const QString &path) int used = 0, levels = 0; const int len = path.length(); - QSTACKARRAY(QChar, out, len); + QStdVector out(len); const QChar *p = path.unicode(); for (int i = 0, last = -1, iwrite = 0; i < len; ++i) { @@ -1698,7 +1698,7 @@ QString QDir::cleanPath(const QString &path) used++; } - QString ret = (used == len ? path : QString(out, used)); + QString ret = (used == len ? path : QString(out.constData(), used)); // Strip away last slash except for root directories if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) { ret.chop(1); -- 2.11.0