Use QString::splitRef in customtype example
There is no need to allocate all these strings Change-Id: I398e1cc05bd3ad24df067a967a5e24fbc6d452ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>bb10
parent
72c99dd446
commit
b3f4e5cbe2
|
|
@ -65,7 +65,8 @@ Message::Message(const QString &body, const QStringList &headers)
|
|||
//! [custom type streaming operator]
|
||||
QDebug operator<<(QDebug dbg, const Message &message)
|
||||
{
|
||||
QStringList pieces = message.body().split("\r\n", QString::SkipEmptyParts);
|
||||
const QString body = message.body();
|
||||
QVector<QStringRef> pieces = body.splitRef("\r\n", QString::SkipEmptyParts);
|
||||
if (pieces.isEmpty())
|
||||
dbg.nospace() << "Message()";
|
||||
else if (pieces.size() == 1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue