aboutsummaryrefslogtreecommitdiff
path: root/room.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-19 10:43:10 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-19 10:55:43 +0900
commit4e23da3de66e425997506c75204a9e3ea22ccfa5 (patch)
treeaecfdd4a8861fecd7fe21d59366080290fec62a3 /room.cpp
parent1b11a6ee708291db37b0c7879eb103d81d70a6b7 (diff)
downloadlibquotient-4e23da3de66e425997506c75204a9e3ea22ccfa5.tar.gz
libquotient-4e23da3de66e425997506c75204a9e3ea22ccfa5.zip
Room: Slight optimization of makeErrorStr()
The previous version constructed QString from const char* and QByteArray parts, only to convert it back to QByteArray; the current version does the whole thing in QByteArray terms.
Diffstat (limited to 'room.cpp')
-rw-r--r--room.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/room.cpp b/room.cpp
index 547b74c4..85953a5c 100644
--- a/room.cpp
+++ b/room.cpp
@@ -406,10 +406,9 @@ void Room::Private::removeMemberFromMap(const QString& username, User* u)
emit q->memberRenamed(formerNamesakes[0]);
}
-inline QByteArray makeErrorStr(const Event* e, const char* msg)
+inline QByteArray makeErrorStr(const Event* e, QByteArray msg)
{
- return QString("%1; event dump follows:\n%2")
- .arg(msg, QString(e->originalJson())).toUtf8();
+ return msg.append("; event dump follows:\n").append(e->originalJson());
}
void Room::Private::insertEvent(RoomEvent* e, Timeline::iterator where,