summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-07-31 16:39:36 +0200
committerJesus Fernandez <Jesus.Fernandez@qt.io>2018-08-06 10:04:55 +0000
commitadea4cf012cdc33929253c57c691553bb8f199fe (patch)
treea748d0634b2225d6f6ee065b31c1941c2e1d3190 /src/corelib/io
parentd9c3dbc93a466936a1385a5b15656bd14c67d98e (diff)
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>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qurl.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 399c3b8861..f200419fcd 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -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