From d8c843f05f55034edbda38bd84858f4713399fde Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 12 May 2020 08:48:15 +0200 Subject: [PATCH] =?UTF-8?q?QUrlIdna:=20QChar(0x2d)=20=E2=86=92=20QLatin1Ch?= =?UTF-8?q?ar('-')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A reader of the code shoudn't need to know ASCII code points by heart, so don't force them to. Change-Id: I2c44fcf4a948b85dfbc02ac8b5b7b934e87b41a7 Reviewed-by: Edward Welbourne --- src/corelib/io/qurlidna.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 9ef12899f0..49d84c2dbf 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2240,7 +2240,7 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(const QChar *s, int ucLength, QString // if basic code points were copied, add the delimiter character. if (h > 0) - *output += QChar(0x2d); + *output += QLatin1Char{'-'}; // while there are still unprocessed non-basic code points left in // the input string... @@ -2305,7 +2305,7 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc) // find the last delimiter character '-' in the input array. copy // all data before this delimiter directly to the output array. - int delimiterPos = pc.lastIndexOf(QChar(0x2d)); + int delimiterPos = pc.lastIndexOf(QLatin1Char{'-'}); QString output = delimiterPos < 4 ? QString() : pc.mid(start, delimiterPos - start);