diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-09-19 10:43:10 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-09-19 10:55:43 +0900 |
commit | 4e23da3de66e425997506c75204a9e3ea22ccfa5 (patch) | |
tree | aecfdd4a8861fecd7fe21d59366080290fec62a3 /room.cpp | |
parent | 1b11a6ee708291db37b0c7879eb103d81d70a6b7 (diff) | |
download | libquotient-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.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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, |