From 732b37aca02bb788fbb995ff97d26233dd308f1f Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 1 Jul 2019 19:20:57 +0200 Subject: [PATCH] Use QMap::contains() --- ext/libstrawberry-common/core/messagehandler.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/libstrawberry-common/core/messagehandler.h b/ext/libstrawberry-common/core/messagehandler.h index 5846f4768..71936326a 100644 --- a/ext/libstrawberry-common/core/messagehandler.h +++ b/ext/libstrawberry-common/core/messagehandler.h @@ -150,10 +150,9 @@ bool AbstractMessageHandler::RawMessageArrived(const QByteArray &data) { return false; } - ReplyType *reply = pending_replies_.take(message.id()); - - if (reply) { + if (pending_replies_.contains(message.id())) { // This is a reply to a message that we created earlier. + ReplyType *reply = pending_replies_.take(message.id()); reply->SetReply(message); } else {