mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 03:28:41 -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
|
@ -659,7 +659,13 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
|
|||
{
|
||||
// strip redundant quotes
|
||||
if (arg.startsWith(u'"') && arg.endsWith(u'"'))
|
||||
arg = arg.mid(1, (arg.size() - 2));
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||
arg.slice(1, (arg.size() - 2));
|
||||
#else
|
||||
arg.removeLast().removeFirst();
|
||||
#endif
|
||||
}
|
||||
|
||||
arg = replaceVariables(arg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue