X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fctcpparser.cpp;h=63c3dde92150e15bf9da31ac17ee48b1cc4f62e4;hb=c351c94e52a01571c34a18ddb5947b9e1f771d8c;hp=f4177c6e4351616ab5aeeb10f52a31c8d71a15ef;hpb=88b350153eb364853e75d237d3eed2dfaf839d59;p=quassel.git diff --git a/src/core/ctcpparser.cpp b/src/core/ctcpparser.cpp index f4177c6e..63c3dde9 100644 --- a/src/core/ctcpparser.cpp +++ b/src/core/ctcpparser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2010 by the Quassel Project * + * Copyright (C) 2005-2012 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -250,13 +250,10 @@ void CtcpParser::packedReply(CoreNetwork *net, const QString &bufname, const QLi answerSize += replies.at(i).size(); } - QByteArray quotedReply(answerSize, 0); - int nextPos = 0; - QByteArray &reply = quotedReply; + QByteArray quotedReply; + quotedReply.reserve(answerSize); for(int i = 0; i < replies.count(); i++) { - reply = replies.at(i); - quotedReply.replace(nextPos, reply.size(), reply); - nextPos += reply.size(); + quotedReply.append(replies.at(i)); } params << net->serverEncode(bufname) << quotedReply;