Simplify QUrlPrivate::appendHost

Coverity-Id: 191128
Change-Id: I70f2d8b2e0063783851c1520862c2845c8908321
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Robbert Proost <robbert.proost@outlook.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Jesus Fernandez 2018-07-31 16:39:36 +02:00 committed by Jesus Fernandez
parent d9c3dbc93a
commit adea4cf012
1 changed files with 3 additions and 7 deletions

View File

@ -1207,14 +1207,10 @@ inline void QUrlPrivate::appendHost(QString &appendTo, QUrl::FormattingOptions o
return;
if (host.at(0).unicode() == '[') {
// IPv6 addresses might contain a zone-id which needs to be recoded
QString hostInCorrectFormat;
if (options != 0)
qt_urlRecode(hostInCorrectFormat, host.constBegin(), host.constEnd(), options, 0);
if (hostInCorrectFormat.isEmpty())
hostInCorrectFormat = host;
appendTo += hostInCorrectFormat;
if (qt_urlRecode(appendTo, host.constBegin(), host.constEnd(), options, 0))
return;
appendTo += host;
} else {
// this is either an IPv4Address or a reg-name
// if it is a reg-name, it is already stored in Unicode form