Use startsWith() instead of left(4)

This commit is contained in:
Michael Steenbeek 2023-08-29 17:53:37 +02:00 committed by Felix Queißner
parent 10a9c4ccfa
commit 3709c3d6bd
1 changed files with 2 additions and 2 deletions

View File

@ -157,8 +157,8 @@ std::unique_ptr<QTextDocument> GophermapRenderer::render(const QByteArray &input
{
QString dst_url;
// If a resources link starts with “URL:”, it is a direct link (to HTTP or another protocol), rather than a file or directory on this server.
if (items.size() >= 2 && items.at(1).left(4) == "URL:")
// If a resources path starts with “URL:”, it is a direct link (to HTTP or another protocol), rather than a file or directory on this server.
if (items.size() >= 2 && items.at(1).startsWith("URL:"))
{
auto item1 = QString(items.at(1));
item1.remove(0, 4);