mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Use slice method where applicable
These code segments already have its boundary checked and can thus be faster. PR #22411.
This commit is contained in:
@@ -89,8 +89,8 @@ namespace
|
||||
if (idx < 0)
|
||||
continue;
|
||||
|
||||
const QString name = cookie.left(idx).trimmed().toString();
|
||||
const QString value = Utils::String::unquote(cookie.mid(idx + 1).trimmed()).toString();
|
||||
const QString name = cookie.first(idx).trimmed().toString();
|
||||
const QString value = Utils::String::unquote(cookie.sliced(idx + 1).trimmed()).toString();
|
||||
ret.insert(name, value);
|
||||
}
|
||||
return ret;
|
||||
@@ -469,8 +469,8 @@ void WebApplication::configure()
|
||||
continue;
|
||||
}
|
||||
|
||||
const QString header = line.left(idx).trimmed().toString();
|
||||
const QString value = line.mid(idx + 1).trimmed().toString();
|
||||
const QString header = line.first(idx).trimmed().toString();
|
||||
const QString value = line.sliced(idx + 1).trimmed().toString();
|
||||
m_prebuiltHeaders.push_back({header, value});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user