mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-31 12:00:16 -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
|
@ -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});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue