Skip to content

Commit

Permalink
Simplify QUrlPrivate::appendHost
Browse files Browse the repository at this point in the history
Coverity-Id: 191128
Change-Id: I70f2d8b2e0063783851c1520862c2845c8908321
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Robbert Proost <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
jsfdez committed Aug 6, 2018
1 parent d9c3dbc commit adea4cf
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/corelib/io/qurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit adea4cf

Please sign in to comment.