From b2c1609b21f5a3e4eb4385ee7f89cefcc4042ec1 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Mon, 22 Sep 2014 22:31:06 +0200 Subject: [PATCH] Small optimization No need to copy the list around. --- src/core/ctcpparser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/ctcpparser.cpp b/src/core/ctcpparser.cpp index db285a68..33845f66 100644 --- a/src/core/ctcpparser.cpp +++ b/src/core/ctcpparser.cpp @@ -313,7 +313,6 @@ QByteArray CtcpParser::pack(const QByteArray &ctcpTag, const QByteArray &message void CtcpParser::query(CoreNetwork *net, const QString &bufname, const QString &ctcpTag, const QString &message) { QList params; - QList newparams; params << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message))); static const char *splitter = " .,-!?"; @@ -329,8 +328,8 @@ void CtcpParser::query(CoreNetwork *net, const QString &bufname, const QString & } if (splitPos <= 0 || splitPos > maxSplitPos) splitPos = maxSplitPos; - newparams << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message.left(splitPos)))); - params = newparams; + + params = params.mid(0, 1) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message.left(splitPos)))); } net->putCmd("PRIVMSG", params); -- 2.20.1