mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user