summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-03-30 14:23:12 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-03-31 07:47:29 +0000
commit3cbe25c9a657b3fbefd194df5dd34a7cbabb9331 (patch)
tree6ff49a41111bf7060a1a928923e782aea72352b2 /src/network/kernel
parent5323ffed64215ede3c112f0efcb88e0be18f0982 (diff)
QtNetwork: use QStringRef to optimize memory allocation
Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: I697f776c60003629990cfd197534ffed63bafe2f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qhostaddress.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 6ccf40680a..0dbe1112cd 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -1041,11 +1041,11 @@ QPair<QHostAddress, int> QHostAddress::parseSubnet(const QString &subnet)
return invalid; // invalid netmask
// parse the address manually
- QStringList parts = netStr.split(QLatin1Char('.'));
+ auto parts = netStr.splitRef(QLatin1Char('.'));
if (parts.isEmpty() || parts.count() > 4)
return invalid; // invalid IPv4 address
- if (parts.last().isEmpty())
+ if (parts.constLast().isEmpty())
parts.removeLast();
quint32 addr = 0;