Remove a useless message copy

This commit is contained in:
David Sansome 2012-11-07 09:18:12 +11:00
parent 0822482b4d
commit 95df1a4c25

View File

@ -356,11 +356,7 @@ typename WorkerPool<HandlerType>::ReplyType*
WorkerPool<HandlerType>::SendMessageWithReply(MessageType* message) { WorkerPool<HandlerType>::SendMessageWithReply(MessageType* message) {
ReplyType* reply = NewReply(message); ReplyType* reply = NewReply(message);
// Copy the message // Add the pending reply to the queue
MessageType copy;
copy.MergeFrom(*message);
// Add the copy to the queue
{ {
QMutexLocker l(&message_queue_mutex_); QMutexLocker l(&message_queue_mutex_);
message_queue_.enqueue(reply); message_queue_.enqueue(reply);