Apply suggestions from code review

Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
This commit is contained in:
Zentino 2024-12-17 08:14:00 +08:00 committed by GitHub
commit 6f103cfdc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -653,11 +653,8 @@ namespace
if (relativePath.startsWith(u'/')) if (relativePath.startsWith(u'/'))
relativePath = relativePath.mid(1); relativePath = relativePath.mid(1);
QString absoluteUrl; const QString absoluteUrl = !host.isEmpty()
if (!host.isEmpty()) ? (defaultScheme + u":" + host) : (normalizedBaseUrl + relativePath);
absoluteUrl = defaultScheme + u":" + host;
else
absoluteUrl = normalizedBaseUrl + relativePath;
const QString fullMatch = match.captured(0); const QString fullMatch = match.captured(0);
const QString prefix = match.captured(1); const QString prefix = match.captured(1);
const QString suffix = match.captured(7); const QString suffix = match.captured(7);