From 5ae671dc140011cb1b659a0b1553f681484ead56 Mon Sep 17 00:00:00 2001 From: fourtf Date: Fri, 22 Jun 2018 23:28:20 +0200 Subject: [PATCH] accidentally added a line --- src/providers/twitch/twitchserver.cpp | 28 ++++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/providers/twitch/twitchserver.cpp b/src/providers/twitch/twitchserver.cpp index 321e43443..ac3b02575 100644 --- a/src/providers/twitch/twitchserver.cpp +++ b/src/providers/twitch/twitchserver.cpp @@ -194,25 +194,21 @@ void TwitchServer::forEachChannelAndSpecialChannels(std::function TwitchServer::getChannelOrEmptyByID(const QString &channelID) { - this->forEachChannel(); + std::lock_guard lock(this->channelMutex); - { - std::lock_guard lock(this->channelMutex); + for (const auto &weakChannel : this->channels) { + auto channel = weakChannel.lock(); + if (!channel) { + continue; + } - for (const auto &weakChannel : this->channels) { - auto channel = weakChannel.lock(); - if (!channel) { - continue; - } + auto twitchChannel = std::dynamic_pointer_cast(channel); + if (!twitchChannel) { + continue; + } - auto twitchChannel = std::dynamic_pointer_cast(channel); - if (!twitchChannel) { - continue; - } - - if (twitchChannel->roomID == channelID) { - return twitchChannel; - } + if (twitchChannel->roomID == channelID) { + return twitchChannel; } }