diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-08-04 20:19:21 +0300 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-08-05 13:30:56 +0300 |
commit | d88c6a1690d1d725e4436537546b3d5681ee4a9f (patch) | |
tree | 98343163298cc13ddd9b40015ceb5275566e5390 /src/remoteobjects/qremoteobjectsourceio.cpp | |
parent | d71556d50498548a6b765c6c7bb9d997813fc7f3 (diff) |
Annual QStringLiteral sweep
It makes little sense to use QStringLiteral in the following
situations:
- for comparison to a QString, because operator==, startsWith(),
indexOf() etc are overloaded for QLatin1String.
- for strings which are immediately appended to, or which are
appended or prepended to other strings.
because no dynamic memory allocation is saved by doing so. But if
the only advantage of QStringLiteral does not apply, all its
disadvantages dominate, to wit: injection of calls to the QString
dtor, non-sharability of data between C strings and QStringLiterals
and among QStringLiterals, and doubled storage requirements.
Fix by replacing QStringLiteral with QLatin1String, or char16_t
literals, whichever is more fitting.
Also use new QLatin1String::arg() more.
Change-Id: I55d05783889f521001a1cb8dedd276d0a183882f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/remoteobjects/qremoteobjectsourceio.cpp')
-rw-r--r-- | src/remoteobjects/qremoteobjectsourceio.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remoteobjects/qremoteobjectsourceio.cpp b/src/remoteobjects/qremoteobjectsourceio.cpp index f5d068d..a6cdd11 100644 --- a/src/remoteobjects/qremoteobjectsourceio.cpp +++ b/src/remoteobjects/qremoteobjectsourceio.cpp @@ -220,7 +220,7 @@ void QRemoteObjectSourceIo::onServerRead(QObject *conn) { int call, index, serialId, propertyId; deserializeInvokePacket(connection->stream(), call, index, m_rxArgs, serialId, propertyId); - if (m_rxName == QStringLiteral("Registry") && !m_registryMapping.contains(connection)) { + if (m_rxName == QLatin1String("Registry") && !m_registryMapping.contains(connection)) { const QRemoteObjectSourceLocation loc = m_rxArgs.first().value<QRemoteObjectSourceLocation>(); m_registryMapping[connection] = loc.second.hostUrl; } |