Remove Redundant Parsing of Links (#4507)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-04-23 00:58:37 +02:00
committed by GitHub
parent f2938995c1
commit 95e7426283
10 changed files with 168 additions and 147 deletions
@@ -1,6 +1,7 @@
#include "providers/twitch/TwitchMessageBuilder.hpp"
#include "Application.hpp"
#include "common/LinkParser.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/ignores/IgnoreController.hpp"
@@ -465,12 +466,12 @@ void TwitchMessageBuilder::addTextOrEmoji(const QString &string_)
}
// Actually just text
auto linkString = this->matchLink(string);
LinkParser parsed(string);
auto textColor = this->textColor_;
if (!linkString.isEmpty())
if (parsed.result())
{
this->addLink(string, linkString);
this->addLink(*parsed.result());
return;
}