Switch to string view where applicable

PR #22438.
This commit is contained in:
Chocobo1
2025-03-17 19:28:38 +08:00
committed by GitHub
parent 5a4b3b25d3
commit 8d0870c953
5 changed files with 24 additions and 27 deletions

View File

@@ -96,9 +96,9 @@ void DNSUpdater::ipRequestFinished(const DownloadResult &result)
const QRegularExpressionMatch ipRegexMatch = QRegularExpression(u"Current IP Address:\\s+([^<]+)</body>"_s).match(QString::fromUtf8(result.data));
if (ipRegexMatch.hasMatch())
{
QString ipStr = ipRegexMatch.captured(1);
const QString ipStr = ipRegexMatch.captured(1);
qDebug() << Q_FUNC_INFO << "Regular expression captured the following IP:" << ipStr;
QHostAddress newIp(ipStr);
const QHostAddress newIp {ipStr};
if (!newIp.isNull())
{
if (m_lastIP != newIp)