mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07: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:
parent
d174bc75e4
commit
5a4b3b25d3
23 changed files with 113 additions and 63 deletions
|
@ -82,7 +82,13 @@ namespace
|
|||
|
||||
QString relativePath = match.captured(6);
|
||||
if (relativePath.startsWith(u'/'))
|
||||
relativePath = relativePath.mid(1);
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||
relativePath.slice(1);
|
||||
#else
|
||||
relativePath.remove(0, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
const QString absoluteUrl = !host.isEmpty()
|
||||
? QString(defaultScheme + u':' + host) : (normalizedBaseUrl + relativePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue