Commit 3c49248a authored by Tomaz Canabrava's avatar Tomaz Canabrava Committed by Tomaz Canabrava
Browse files

Use ternary to return a multiple choice

parent 609b09e8
......@@ -397,14 +397,9 @@ UrlFilter::HotSpot::HotSpot(int startLine, int startColumn, int endLine, int end
UrlFilter::HotSpot::UrlType UrlFilter::HotSpot::urlType() const
{
const QString url = capturedTexts().at(0);
if (FullUrlRegExp.match(url).hasMatch()) {
return StandardUrl;
} else if (EmailAddressRegExp.match(url).hasMatch()) {
return Email;
} else {
return Unknown;
}
return FullUrlRegExp.match(url).hasMatch() ? StandardUrl
: EmailAddressRegExp.match(url).hasMatch() ? Email
: Unknown;
}
void UrlFilter::HotSpot::activate(QObject *object)
......@@ -562,6 +557,7 @@ QString createFileRegex(const QStringList &patterns, const QString &filePattern,
QStringList prefixes = patterns.filter(QRegularExpression(QStringLiteral("^") + filePattern + QStringLiteral("+\\*$")));
const QStringList fullNames = patterns.filter(QRegularExpression(QStringLiteral("^") + filePattern + QStringLiteral("$")));
suffixes.replaceInStrings(QStringLiteral("*"), QString());
suffixes.replaceInStrings(QStringLiteral("."), QStringLiteral("\\."));
prefixes.replaceInStrings(QStringLiteral("*"), QString());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment