QHostAddress: enable (N)RVO in toString() for gcc
Change-Id: I5f8d72742cc4199bfa73df6037b851c58632ff86 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>bb10
parent
99b2223406
commit
e2a7d18564
|
|
@ -737,24 +737,17 @@ Q_IPV6ADDR QHostAddress::toIPv6Address() const
|
|||
QString QHostAddress::toString() const
|
||||
{
|
||||
QT_ENSURE_PARSED(this);
|
||||
QString s;
|
||||
if (d->protocol == QAbstractSocket::IPv4Protocol
|
||||
|| d->protocol == QAbstractSocket::AnyIPProtocol) {
|
||||
quint32 i = toIPv4Address();
|
||||
QString s;
|
||||
QIPAddressUtils::toString(s, i);
|
||||
return s;
|
||||
}
|
||||
|
||||
if (d->protocol == QAbstractSocket::IPv6Protocol) {
|
||||
QString s;
|
||||
} else if (d->protocol == QAbstractSocket::IPv6Protocol) {
|
||||
QIPAddressUtils::toString(s, d->a6.c);
|
||||
|
||||
if (!d->scopeId.isEmpty())
|
||||
s.append(QLatin1Char('%') + d->scopeId);
|
||||
return s;
|
||||
}
|
||||
|
||||
return QString();
|
||||
return s;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
Loading…
Reference in New Issue